Skip to content

Instantly share code, notes, and snippets.

@pepepper
Created January 30, 2020 14:50
Show Gist options
  • Save pepepper/337562ac55431669c94d7591da32a223 to your computer and use it in GitHub Desktop.
Save pepepper/337562ac55431669c94d7591da32a223 to your computer and use it in GitHub Desktop.
#include "sleepy-discord/include/sleepy_discord/websocketpp_websocket.h"
class MyClientClass : public SleepyDiscord::DiscordClient {
public:
using SleepyDiscord::DiscordClient::DiscordClient;
void onMessage(SleepyDiscord::Message message) override {
if (message.content.find("Fuck")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "Go to hell " + message.author.username);
if (message.content.find("遊ぼう")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "遊ぼう");
if (message.content.find("馬鹿")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "馬鹿");
if (message.content.find("もう遊ばない")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "遊ばない");
if (message.content.find("ごめんね")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "ごめんね");
if (message.content.find("こだま?")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "のぞみです!");
if (message.content.find("えー")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "えーじゃない");
if (message.content.find("ふるへっへっへ")!=std::string::npos&&message.author.username!="時雨谷") sendMessage(message.channelID, "もー");
}
};
int main() {
MyClientClass client("your token",2);
client.run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment