Création Repo pour mon bot Le Tamiseur
This commit is contained in:
17
commands/global/update.js
Executable file
17
commands/global/update.js
Executable file
@@ -0,0 +1,17 @@
|
||||
const { SlashCommandBuilder } = require('discord.js')
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('update')
|
||||
.setDescription('Update the member count channel.'),
|
||||
async execute(interaction) {
|
||||
let guild = interaction.guild
|
||||
guild.members.fetch().then(() => {
|
||||
var i = 0
|
||||
guild.members.cache.forEach(async member => { if (!member.user.bot) i++ })
|
||||
let channel = guild.channels.cache.get('1091140609139560508')
|
||||
channel.setName(`${i} Gens Posés`)
|
||||
interaction.reply(`${i} Gens Posés !`)
|
||||
}).catch(console.error)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user