Compare commits

...

2 Commits

Author SHA1 Message Date
349cb03844 init: dockerfile 2023-10-07 23:21:50 +00:00
df5f8c3227 add: delete button 2023-10-07 23:21:42 +00:00
2 changed files with 31 additions and 1 deletions

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM debian
RUN apt update
RUN apt upgrade
RUN apt install make
RUN apt install cmake
RUN apt install git
RUN apt install wget
# install the dpp lib
RUN apt install wget
RUN wget -O dpp.deb https://dl.dpp.dev/
RUN dpkg -i dpp.deb
RUN git clone https://git.chauvet.pro/starnakin/PyMenuBOT /app
WORKDIR /app
RUN make
ENTRYPOINT ["./PyMenu"]

View File

@ -14,7 +14,6 @@ int main()
{ {
if (event.msg.author.id == bot.me.id) 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); bot.message_add_reaction(event.msg, dpp::unicode_emoji::white_check_mark);
} }
else else
@ -35,6 +34,15 @@ int main()
} }
}); });
bot.on_message_reaction_add([&bot](const dpp::message_reaction_add_t& event)
{
if (event.reacting_user.id == bot.me.id)
return;
dpp::emoji emoji = event.reacting_emoji;
if (emoji.name == dpp::unicode_emoji::white_check_mark)
bot.message_delete(event.message_id, event.channel_id);
});
bot.on_ready([&bot](const dpp::ready_t& event) bot.on_ready([&bot](const dpp::ready_t& event)
{ {
std::cout << bot.me.id << std::endl; std::cout << bot.me.id << std::endl;