initial commit'
This commit is contained in:
7
events/ ready.js
Normal file
7
events/ ready.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
name: 'ready',
|
||||
once: true,
|
||||
execute(client) {
|
||||
console.log(`Ready! Logged in as ${client.user.tag}`);
|
||||
},
|
||||
};
|
18
events/guildMemberAdd.js
Normal file
18
events/guildMemberAdd.js
Normal file
@ -0,0 +1,18 @@
|
||||
const { WelcomeChannel } = require("discord.js");
|
||||
const { userMention } = require("@discordjs/builders");
|
||||
|
||||
module.exports = {
|
||||
name: 'guildMemberAdd',
|
||||
async execute(member, guild) {
|
||||
|
||||
await guild.fetchWelcomeScreen()
|
||||
.then(() => {
|
||||
const channel = this.welcomeChannels;
|
||||
channel.forEach(element => {
|
||||
const nickname = memberNicknameMention(member.id);
|
||||
await interaction.reply('Bienvenue ' + nickname + ' ! Mets toi à l\'aise, il y a des bières dans le frigo.');
|
||||
})
|
||||
})
|
||||
.catch(console.error);
|
||||
},
|
||||
};
|
17
events/interactionCreate.js
Normal file
17
events/interactionCreate.js
Normal file
@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
name: 'interactionCreate',
|
||||
async execute(interaction) {
|
||||
if (!interaction.isCommand()) return;
|
||||
|
||||
const command = interaction.client.commands.get(interaction.commandName);
|
||||
|
||||
if (!command) return;
|
||||
|
||||
try {
|
||||
await command.execute(interaction);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
|
||||
} console.log(`${interaction.user.tag} in #${interaction.channel.name} triggered an interaction.`);
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user