diff --git a/src/commands/beginner.cpp b/src/commands/beginner.cpp index 7222e37..a9eeb82 100644 --- a/src/commands/beginner.cpp +++ b/src/commands/beginner.cpp @@ -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); } diff --git a/src/commands/commands.h b/src/commands/commands.h index edfc965..7eb7634 100644 --- a/src/commands/commands.h +++ b/src/commands/commands.h @@ -91,7 +91,7 @@ struct cmdStruct typedef std::function cmdFunc; cmdFunc function; - std::list args; + std::vector args; dpp::permissions permissions; }; diff --git a/src/globals/globals.h b/src/globals/globals.h index da4c962..8f753f3 100644 --- a/src/globals/globals.h +++ b/src/globals/globals.h @@ -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.