Skip to content

Commit

Permalink
fix: 🐛 fix unknown symbol on windows; edit COMMAND_ALLOC and COMMAND_…
Browse files Browse the repository at this point in the history
…FREE macros to forward declare struct; reformat
  • Loading branch information
Xminent committed Dec 10, 2023
1 parent c4d13fa commit 50c41ea
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 195 deletions.
22 changes: 9 additions & 13 deletions commands/Fun/8ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ using namespace saber;

struct Eightball : Command {
explicit Eightball(Saber *creator)
: Command(creator,
: Command(
creator,
CommandOptions{
"8ball",
DIRNAME,
Expand All @@ -14,26 +15,21 @@ struct Eightball : Command {
{},
{},
{},
{ "eight-ball", "eightball" },
{"eight-ball", "eightball"},
"8ball <question>",
"Asks the Magic 8-Ball for some psychic wisdom.",
{ ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks },
{ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks},
{},
{},
{},
3000,
})
{
}
}) {}

void setup() override
{
}
void setup() override {}

void execute(const ekizu::Message &message,
const std::vector<std::string> &args) override
{
const std::vector<std::string> &args) override {
if (args.empty()) {
(void)bot->http.create_message(message.channel_id)
.content("You need to ask a question!")
Expand All @@ -49,7 +45,7 @@ struct Eightball : Command {
.send();
}

private:
private:
std::vector<std::string> responses{
"It is certain.",
"It is decidedly so.",
Expand Down
51 changes: 24 additions & 27 deletions commands/Fun/beep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,32 @@ using namespace saber;

struct Beep : Command {
explicit Beep(Saber *creator)
: Command(creator, CommandOptions{
"beep",
DIRNAME,
true,
{},
{},
{},
{},
{},
"beep",
"Replies with boop.",
{ ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks },
{},
{},
{},
3000,
})
{
}
: Command(
creator,
CommandOptions{
"beep",
DIRNAME,
true,
{},
{},
{},
{},
{},
"beep",
"Replies with boop.",
{ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks},
{},
{},
{},
3000,
}) {}

void setup() override
{
}
void setup() override {}

void
execute(const ekizu::Message &message,
[[maybe_unused]] const std::vector<std::string> &args) override
{
void execute(
const ekizu::Message &message,
[[maybe_unused]] const std::vector<std::string> &args) override {
(void)bot->http.create_message(message.channel_id)
.content("Boop!")
.send();
Expand Down
58 changes: 26 additions & 32 deletions commands/Fun/countdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,35 @@ using namespace saber;

struct Countdown : Command {
explicit Countdown(Saber *creator)
: Command(creator, CommandOptions{
"countdown",
DIRNAME,
true,
{},
{},
{},
{},
{},
"countdown",
"Start counting down from 5.",
{ ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks },
{},
{},
{},
0,
})
{
}

void setup() override
{
}
: Command(
creator,
CommandOptions{
"countdown",
DIRNAME,
true,
{},
{},
{},
{},
{},
"countdown",
"Start counting down from 5.",
{ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks},
{},
{},
{},
0,
}) {}

void setup() override {}

void execute(const ekizu::Message &message,
const std::vector<std::string> &args) override
{
if (!args.empty()) {
return;
}
const std::vector<std::string> &args) override {
if (!args.empty()) { return; }

const std::vector<std::string> countdown{ "five", "four",
"three", "two",
"one" };
const std::vector<std::string> countdown{
"five", "four", "three", "two", "one"};

for (const std::string &num : countdown) {
(void)bot->http.create_message(message.channel_id)
Expand Down
56 changes: 27 additions & 29 deletions commands/Fun/css.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,39 @@ using namespace saber;

struct CSS : Command {
explicit CSS(Saber *creator)
: Command(creator, CommandOptions{
"css",
DIRNAME,
true,
{},
{},
{},
{},
{},
"css",
"",
{ ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks },
{},
{},
{},
0,
})
{
}
: Command(
creator,
CommandOptions{
"css",
DIRNAME,
true,
{},
{},
{},
{},
{},
"css",
"",
{ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks},
{},
{},
{},
0,
}) {}

void setup() override
{
}
void setup() override {}

void execute(const ekizu::Message &message,
const std::vector<std::string> &args) override
{
if (!args.empty()) {
return;
}
const std::vector<std::string> &args) override {
if (!args.empty()) { return; }

(void)bot->http.create_message(message.channel_id)
.content(
"https://media2.giphy.com/media/yYSSBtDgbbRzq/giphy.gif?cid=ecf05e47ckbtzm84p629vw655dbua1qzaiw8tl46ejp4f0xj&ep=v1_gifs_search&rid=giphy.gif&ct=g")
"https://media2.giphy.com/media/yYSSBtDgbbRzq/"
"giphy.gif?cid="
"ecf05e47ckbtzm84p629vw655dbua1qzaiw8tl46ejp4f0xj&ep=v1_gifs_"
"search&rid=giphy.gif&ct=g")
.send();
}
};
Expand Down
71 changes: 32 additions & 39 deletions commands/Fun/hype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,52 @@ using namespace saber;

struct Hype : Command {
explicit Hype(Saber *creator)
: Command(creator, CommandOptions{
"hype",
DIRNAME,
true,
{},
{},
{},
{},
{ "hypu", "train" },
"hype",
"",
{ ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks },
{},
{},
{},
0,
})
{
}

void setup() override
{
}
: Command(
creator,
CommandOptions{
"hype",
DIRNAME,
true,
{},
{},
{},
{},
{"hypu", "train"},
"hype",
"",
{ekizu::Permissions::SendMessages,
ekizu::Permissions::EmbedLinks},
{},
{},
{},
0,
}) {}

void setup() override {}

void execute(const ekizu::Message &message,
const std::vector<std::string> &args) override
{
if (!args.empty()) {
return;
}
const std::vector<std::string> &args) override {
if (!args.empty()) { return; }

const std::string &selectedHype =
hypu[util::get_random_number<size_t>(0,
hypu.size() - 1)];
hypu[util::get_random_number<size_t>(0, hypu.size() - 1)];
std::string msg = ":train2: CHOO CHOO " + selectedHype;

(void)bot->http.create_message(message.channel_id)
.content(msg)
.send();
(void)bot->http.create_message(message.channel_id).content(msg).send();
}

private:
private:
std::vector<std::string> hypu{
"https://cdn.discordapp.com/attachments/102817255661772800/219514281136357376/tumblr_nr6ndeEpus1u21ng6o1_540.gif",
"https://cdn.discordapp.com/attachments/102817255661772800/219518372839161859/tumblr_n1h2afSbCu1ttmhgqo1_500.gif",
"https://cdn.discordapp.com/attachments/102817255661772800/"
"219514281136357376/tumblr_nr6ndeEpus1u21ng6o1_540.gif",
"https://cdn.discordapp.com/attachments/102817255661772800/"
"219518372839161859/tumblr_n1h2afSbCu1ttmhgqo1_500.gif",
"https://gfycat.com/HairyFloweryBarebirdbat",
"https://i.imgur.com/PFAQSLA.gif",
"https://abload.de/img/ezgif-32008219442iq0i.gif",
"https://i.imgur.com/vOVwq5o.jpg",
"https://i.imgur.com/Ki12X4j.jpg",
"https://media.giphy.com/media/b1o4elYH8Tqjm/giphy.gif"
};
"https://media.giphy.com/media/b1o4elYH8Tqjm/giphy.gif"};
};

COMMAND_ALLOC(Hype)
Expand Down
Loading

0 comments on commit 50c41ea

Please sign in to comment.