Compare commits

..

No commits in common. "98ea70d35b6a2b52510a09bbe204cabe1831c2ff" and "d118b3cd1f5c67d176394263f320ae14c27d73cd" have entirely different histories.

5 changed files with 3 additions and 61 deletions

View file

@ -1,13 +0,0 @@
import { SlashCommandBuilder } from '@discordjs/builders';
import fetch from 'node-fetch';
export default {
data: new SlashCommandBuilder()
.setName('inspirobot')
.setDescription('Get an image from inspirobot'),
async execute(interaction) {
fetch('http://inspirobot.me/api?generate=true')
.then(res => res.text())
.then(body => interaction.reply({ files: [body] }));
},
};

View file

@ -1,22 +0,0 @@
import { SlashCommandBuilder } from '@discordjs/builders';
import dotenv from 'dotenv';
import process from 'node:process';
dotenv.config();
const { ownerId } = process.env;
export default {
data: new SlashCommandBuilder()
.setName('die')
.setDescription('Kill the bot'),
async execute(interaction) {
if (interaction.user.id !== ownerId) {
return interaction.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true });
}
console.log('\x1b[31m\x1b[47m\x1b[5mSHUTING DOWN!!!!!\x1b[0m');
await interaction.reply({ content: 'Good bye', ephemeral: true })
.then(() => {
console.log('\x1b[31m\x1b[47m\x1b[5mSHUTING DOWN!!!!!\x1b[0m');
process.exit(1);
});
},
};

View file

@ -45,10 +45,6 @@ const commands = [
option.setName('feedback') option.setName('feedback')
.setDescription('The message you want to send me.') .setDescription('The message you want to send me.')
.setRequired(true)), .setRequired(true)),
new SlashCommandBuilder()
.setName('inspirobot')
.setDescription('Get an image from inspirobot'),
] ]
.map(command => command.toJSON()); .map(command => command.toJSON());

View file

@ -1,18 +0,0 @@
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
require('dotenv').config();
const { clientId, guildId, token } = process.env;
const commands = [
new SlashCommandBuilder()
.setName('die')
.setDescription('Kill the bot'),
]
.map(command => command.toJSON());
const rest = new REST({ version: '9' }).setToken(token);
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
.then(() => console.log(`Successfully registered application commands for the guild ${guildId}.`))
.catch(console.error);

View file

@ -9,17 +9,16 @@ const { token } = process.env;
const __filename = fileURLToPath(import.meta.url); const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename); const __dirname = path.dirname(__filename);
const client = new Client({ intents: [Intents.FLAGS.GUILDS], shards: 'auto' }); const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
// Load commands // Load commands
client.commands = new Collection(); client.commands = new Collection();
await loadCommandFromDir('fun'); await loadCommandFromDir('fun');
await loadCommandFromDir('utility'); await loadCommandFromDir('utility');
await loadCommandFromDir('owner');
// Load events // Load events
await loadEventFromDir('client', client); loadEventFromDir('client', client);
await loadEventFromDir('process', process); loadEventFromDir('process', process);
client.login(token); client.login(token);