Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions src/commands/beginner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,50 @@ void cmd::beginnerCommand(dpp::cluster& bot, const dpp::slashcommand_t& event)
{
const dpp::embed embed = dpp::embed()
.set_color(globals::color::defaultColor)
.add_field("πŸ‘‹ New to C++? Start here!", "If you're learning C++, we recommend these resources:\n\nπŸ“˜ **Learn C++ (Best beginner tutorial)**\n- https://www.learncpp.com/\n\nπŸ“– **CPP Reference (Language & Standard library reference)**\n- https://en.cppreference.com/\n\nπŸ› οΈ **Practice**\n1. Build small projects\n2. Read and write lots of code\n\n**Common advice:**\n* βœ… Learn modern C++, not C with classes\n* βœ… Avoid outdated books, videos, and random blog posts that teach old C++ practices\n* ❌ Don't ask ChatGPT or other AI to write your code\n\nIf you're stuck on something specific, ask in the help channels: <#1130494190615265342>.\nBe sure to include your code, any error messages, what you've tried already, and what you expected to happen.");
.set_title("πŸ‘‹ New to C++? Start here!")
.set_url("https://www.learncpp.com/")
.set_description("Essential resources for C++ beginners")
.add_field("πŸ“˜ **Best Beginner Tutorial**",
"LearnCpp.com is widely considered the best free resource:\nhttps://www.learncpp.com/", false)
.add_field("πŸ“– **CPP Reference**",
"The definitive C++ language reference:\nhttps://en.cppreference.com/", false)
.add_field("πŸ› οΈ **Practice**",
"Start with small projects:\n"
"- Calculator\n"
"- Guess game\n"
"- Dice game", false)
.add_field("βœ… **Do this**",
"- Learn Modern C++\n"
"- Use a great IDE\n"
"- Practice what you learn\n"
"- Learn OOP basics\n"
"- Write clean, readable code", true)
.add_field("❌ **Dont do this**",
"- Don't learn from outdated C++ resources\n"
"- Don't let AI write code for you\n"
"- Don't use `using namespace std;` (it's bad practice)\n"
"- Don't ignore compiler warnings", true)
.set_footer(dpp::embed_footer()
.set_text("Need help? Ask in <#" + std::to_string(globals::channels::HELP_CHANNEL_ID) + ">"))
.set_timestamp(dpp::utility::time_f());

const dpp::message message(event.command.channel_id, embed);
dpp::message message(event.command.channel_id, embed);
message.add_component(
dpp::component()
.add_component(
dpp::component()
.set_type(dpp::cot_button)
.set_label("Learn C++")
.set_url("https://www.learncpp.com/")
.set_style(dpp::cos_link)
)
.add_component(
dpp::component()
.set_type(dpp::cot_button)
.set_label("CPP Reference")
.set_url("https://en.cppreference.com/")
.set_style(dpp::cos_link)
)
);
event.reply(message);
}
2 changes: 1 addition & 1 deletion src/commands/commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct cmdStruct
typedef std::function<void(dpp::cluster&, dpp::slashcommand_t)> cmdFunc;
cmdFunc function;

std::list<dpp::command_option> args;
std::vector<dpp::command_option> args;
dpp::permissions permissions;
};

Expand Down
5 changes: 5 additions & 0 deletions src/globals/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace globals
static constexpr int defaultColor = 0x004482;
}

namespace channels
{
constexpr dpp::snowflake HELP_CHANNEL_ID = 1130466207431135394ULL;
}

/**
* @brief Load configured IDs used by the bot.
* @param config Parsed config JSON object.
Expand Down