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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_executable(bot
src/commands/code_cmd.cpp
src/commands/project_cmd.cpp
src/commands/rule_cmd.cpp
src/commands/beginner.cpp

# utils
src/utils/suggestion/suggestion.cpp
Expand Down
12 changes: 12 additions & 0 deletions src/commands/beginner.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "commands.h"
#include "../globals/globals.h"

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>\n* Be sure to include your code, any error messages, what you've tried already, and what you expected to happen.");

const dpp::message message(event.command.channel_id, embed);
event.reply(message);
}
7 changes: 7 additions & 0 deletions src/commands/commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ namespace cmd
* @param event slash command event
*/
void ruleCommand(dpp::cluster& bot, const dpp::slashcommand_t& event);

/**
* @brief Replies with a beginner's guide to C++
* @param bot cluster
* @param event slash command event
*/
void beginnerCommand(dpp::cluster& bot, const dpp::slashcommand_t& event);

namespace utils
{
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ using json = nlohmann::json;

std::vector<cmdStruct> cmdList = {
{ "topic", "Get a topic question", cmd::topicCommand },
{ "beginner", "Get a beginner's guide to C++", cmd::beginnerCommand },
{ "coding", "Get a coding question", cmd::codingCommand },
{ "close", "Close a ticket or forum post", cmd::closeCommand },
{ "ticket", "Open a ticket", cmd::ticketCommand, { dpp::command_option(dpp::command_option_type::co_user, "participant", "Add participant", false) }},
Expand Down
Loading