initial commit

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2025-09-13 17:14:59 +05:30
commit de91a303e2
9 changed files with 234 additions and 0 deletions

29
src/main.cc Normal file
View File

@@ -0,0 +1,29 @@
#include <cstdlib>
#include <dpp/dpp.h>
const char *
get_bot_token () {
return getenv ("BOT_TOKEN");
}
int
main () {
dpp::cluster bot (get_bot_token ());
bot.on_log (dpp::utility::cout_logger ());
bot.on_slashcommand ([] (const dpp::slashcommand_t &event) {
if (event.command.get_command_name () == "ping") {
event.reply ("Pong!");
}
});
bot.on_ready ([&bot] (const dpp::ready_t &_) {
if (dpp::run_once<struct register_bot_commands> ()) {
bot.global_command_create (
dpp::slashcommand ("ping", "Ping pong!", bot.me.id));
}
});
bot.start (dpp::st_wait);
}

15
src/meson.build Normal file
View File

@@ -0,0 +1,15 @@
sources = files(
'main.cc',
)
dpp = dependency('dpp', version: '>=10.1.2', static: true)
libavformat = dependency('libavformat', version: '>=61.7.100')
libavcodec = dependency('libavcodec', version: '>=61.19.101')
executable(
'singh5',
sources,
dependencies: [ dpp, libavformat, libavcodec ],
install : true,
cpp_args: lib_cpp_args
)