generated from mezotv/Discord-Bot-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a96572
commit 48697ac
Showing
6 changed files
with
183 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { | ||
EmbedBuilder, | ||
SlashCommandBuilder, | ||
ActionRowBuilder, | ||
ButtonBuilder, | ||
MessageActionRowComponentBuilder, | ||
bold, | ||
} from "discord.js"; | ||
import { captureException } from "@sentry/node"; | ||
import { ChatInputCommand } from "../../models"; | ||
import Paginator from "../../util/pagination"; | ||
import { UserModel } from "../../util/Models/userModel"; | ||
import Canvas from "canvabase"; | ||
|
||
const command: ChatInputCommand = { | ||
requireGuild: true, | ||
data: new SlashCommandBuilder() | ||
.setName("leaderboard") | ||
.setDescription("Leaderboard statistics for games") | ||
.setDMPermission(false) | ||
.setDescriptionLocalizations({ | ||
de: "Test", | ||
"es-ES": "Test", | ||
fr: "Test", | ||
}) | ||
.addStringOption((option) => | ||
option | ||
.setName("game") | ||
.setDescription("Which game do you want leaderboards from?") | ||
.addChoices({ name: "Higher & Ligher", value: "higherlower" }) | ||
.setRequired(true), | ||
) | ||
.addStringOption((option) => | ||
option | ||
.setName("for") | ||
.setDescription("Pick what type of leaderboard you want to view") | ||
.addChoices( | ||
{ name: "Global", value: "global" }, | ||
{ name: "Local", value: "local" }, | ||
) | ||
.setRequired(true), | ||
), | ||
|
||
/** | ||
* @param {CommandInteraction} interaction | ||
* @param {WouldYou} client | ||
* @param {guildModel} guildDb | ||
*/ | ||
execute: async (interaction, client, guildDb) => { | ||
switch (interaction.options.getString("game")) { | ||
case "higherlower": | ||
const page = new Paginator({ | ||
user: interaction.user.id, | ||
timeout: 180000, | ||
client, | ||
image: null, | ||
}); | ||
|
||
const users = await UserModel.find({ | ||
"higherlower.highscore": { $gt: 1 }, | ||
}); | ||
|
||
|
||
break; | ||
} | ||
}, | ||
}; | ||
|
||
export default command; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters