init
This commit is contained in:
45
src/main.cpp
Normal file
45
src/main.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
#include <string>
|
||||
#include <dpp/dpp.h>
|
||||
#include <dpp/unicode_emoji.h>
|
||||
|
||||
const std::string BOT_TOKEN = "NDkyOTgxMzcwMDg0MzkyOTYw.GAaPMf.LvxTvRkd7pMozkTxC3miWnqM5g7SwxLz2iGVPo";
|
||||
|
||||
int main()
|
||||
{
|
||||
dpp::cluster bot(BOT_TOKEN, dpp::i_default_intents | dpp::i_message_content);
|
||||
|
||||
bot.on_log(dpp::utility::cout_logger());
|
||||
|
||||
bot.on_message_create([&bot](const dpp::message_create_t& event)
|
||||
{
|
||||
if (event.msg.author.id == bot.me.id)
|
||||
{
|
||||
bot.message_add_reaction(event.msg, dpp::unicode_emoji::x);
|
||||
bot.message_add_reaction(event.msg, dpp::unicode_emoji::white_check_mark);
|
||||
}
|
||||
else
|
||||
{
|
||||
dpp::embed embed = dpp::embed()
|
||||
.set_color(dpp::colors::sea_green)
|
||||
.set_title(event.msg.content)
|
||||
.add_field("Quantite", "1", true)
|
||||
.add_field("Prix", "3.29")
|
||||
.set_author(event.msg.author.username, "", "")
|
||||
.set_footer(dpp::embed_footer().set_text("PyMenuVersion:2.0"));
|
||||
|
||||
bot.message_delete(event.msg.id, event.msg.channel_id);
|
||||
|
||||
dpp::message msg(event.msg.channel_id, embed);
|
||||
|
||||
event.send(msg);
|
||||
}
|
||||
});
|
||||
|
||||
bot.on_ready([&bot](const dpp::ready_t& event)
|
||||
{
|
||||
std::cout << bot.me.id << std::endl;
|
||||
(void) event;
|
||||
});
|
||||
|
||||
bot.start(dpp::st_wait);
|
||||
}
|
Reference in New Issue
Block a user