mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
init base
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
const { Events, InteractionType } = require("discord.js")
|
||||
const { Events, InteractionType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name :Events.InteractionCreate,
|
||||
async run(client, interaction) {
|
||||
|
||||
if(interaction.type === InteractionType.ApplicationCommand) {
|
||||
|
||||
const command = client.commands.get(interaction.commandName);
|
||||
await command.execute(interaction, client);
|
||||
};
|
||||
name: Events.InteractionCreate,
|
||||
async run(client, interaction) {
|
||||
if (interaction.type === InteractionType.ApplicationCommand) {
|
||||
const command = client.commands.get(interaction.commandName);
|
||||
await command.execute(interaction, client);
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
+26
-11
@@ -1,15 +1,30 @@
|
||||
const { Events, ActivityType } = require("discord.js")
|
||||
const { Events, ActivityType } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
async run(client) {
|
||||
if (client.commands && Array.isArray(client.commands)) {
|
||||
client.application.commands.set(
|
||||
client.commands.map((command) => command.data)
|
||||
);
|
||||
} else {
|
||||
console.error("Les commandes du client sont manquantes ou mal formatées\n");
|
||||
}
|
||||
console.log(`
|
||||
[${new Date().toLocaleString()}] Logged in as ${client.user.tag} with:
|
||||
- ${client.guilds.cache.size} guilds
|
||||
- ${client.channels.cache.size} channels
|
||||
- ${client.users.cache.size} users
|
||||
`);
|
||||
|
||||
name : Events.ClientReady,
|
||||
async run(client) {
|
||||
client.user.setActivity({
|
||||
name: "&help",
|
||||
type: ActivityType.Streaming, //Playing, Streaming, Listening, Watching, Custom, Competing
|
||||
url: "https://www.twitch.tv/tuturp33"
|
||||
});
|
||||
const activityTypes = ['Playing', 'Streaming', 'Listening', 'Watching', 'Custom', 'Competing'];
|
||||
let activityType = activityTypes[client.user.presence.activities[0].type] || 'Unknown';
|
||||
console.log(`[${new Date().toLocaleString()}] Bot activity set to ${activityType}: ${client.user.presence.activities[0].name}\n`);
|
||||
|
||||
if (client.commands && Array.isArray(client.commands)) {
|
||||
client.application.commands.set(client.commands.map(command => command.data));
|
||||
} else {
|
||||
console.error('Les commandes du client sont manquantes ou mal formatées');
|
||||
}
|
||||
console.log(`${client.user.username} est en ligne`);
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user