added version 2.0
This commit is contained in:
parent
0163d40b4e
commit
0f18925d1a
3231 changed files with 1449 additions and 374732 deletions
31
commands/others/botinfo.js
Normal file
31
commands/others/botinfo.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const { getQuotasSum } = require("../../libs/mysql.js");
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("botinfo")
|
||||
.setDescription("Get information about the bot."),
|
||||
async execute(interaction) {
|
||||
const quotasSum = await getQuotasSum();
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor("#F6C6F9")
|
||||
.setTitle("Bot Info")
|
||||
.setDescription("Information about the bot.")
|
||||
.addFields(
|
||||
{
|
||||
name: "Guilds",
|
||||
value: interaction.client.guilds.cache.size.toString(),
|
||||
inline: false,
|
||||
},
|
||||
{
|
||||
name: "Total quota",
|
||||
value: `${quotasSum[0]["SUM(quota)"]}$`,
|
||||
inline: false,
|
||||
}
|
||||
)
|
||||
.setFooter({ text: "Bot by @ninja_jambon" });
|
||||
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
36
commands/others/getquota.js
Normal file
36
commands/others/getquota.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
const { getUser } = require("../../libs/mysql.js");
|
||||
const { errorEmbed } = require("../../libs/embeds.js");
|
||||
const { sendLog } = require("../../libs/logs.js");
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("getquota")
|
||||
.setDescription("Get your current quota.")
|
||||
.setDMPermission(false),
|
||||
async execute(interaction) {
|
||||
const user = await getUser(interaction.user.id).catch((err) => {
|
||||
sendLog(err);
|
||||
|
||||
const embed = errorEmbed(
|
||||
"An error occured while trying to get your user data."
|
||||
);
|
||||
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
});
|
||||
|
||||
if (!user[0]) {
|
||||
const embed = errorEmbed("You don't have any quota yet.");
|
||||
|
||||
return interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor("#F6C6F9")
|
||||
.setTitle("Quota")
|
||||
.setDescription(`You have ${0.4 - user[0].quota}$ of credits left.`)
|
||||
.setFooter({ text: "Bot by @ninja_jambon" });
|
||||
|
||||
await interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
34
commands/others/help.js
Normal file
34
commands/others/help.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("help")
|
||||
.setDescription("Get help about the bot."),
|
||||
async execute(interaction) {
|
||||
const helpMessage = `
|
||||
**Single requests:**
|
||||
- **/quickgpt**: Make a single request to the GPT-3.5 Turbo model.
|
||||
- **/gptrequest**: Make a single request to the GPT-4 model.
|
||||
|
||||
**Conversations:**
|
||||
- **/addhub**: Add a conversation hub to the channel, user needs to have the ADMINISTRATOR permission and the channel needs to be a forum channel or a normal text channel.
|
||||
- **/closeconv**: Close the conversation in your channel, user needs to be the creator of the conversation.
|
||||
|
||||
**Others:**
|
||||
- **/getquota**: Display your quota, you can use a total of 0.4$ of quota per month.
|
||||
- **/botinfo**: Display information about the bot.
|
||||
|
||||
**Links:**
|
||||
- [Invite the bot](https://discord.com/api/oauth2/authorize?client_id=1059559067846189067&permissions=326417632256&scope=bot)
|
||||
- [Support server](https://discord.gg/WcZPz3nm5p)
|
||||
`;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor("#F6C6F9")
|
||||
.setTitle("Help")
|
||||
.setDescription(helpMessage)
|
||||
.setFooter({ text: "Bot by @ninja_jambon" });
|
||||
|
||||
interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue