Réécriture complète 4.0
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
import { SlashCommandBuilder, ChatInputCommandInteraction, Guild } from 'discord.js'
|
||||
|
||||
export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('update')
|
||||
.setDescription('Update the member count channel.'),
|
||||
async execute(interaction: ChatInputCommandInteraction) {
|
||||
let guild = interaction.guild as Guild
|
||||
|
||||
guild.members.fetch().then(() => {
|
||||
let i = 0
|
||||
guild.members.cache.forEach(async member => { if (!member.user.bot) i++ })
|
||||
let channel = guild.channels.cache.get('1091140609139560508')
|
||||
if (!channel) return
|
||||
channel.setName(`${i} Gens Posés`)
|
||||
interaction.reply(`${i} Gens Posés !`)
|
||||
}).catch(console.error)
|
||||
}
|
||||
}
|
||||
import { SlashCommandBuilder, MessageFlags } from "discord.js"
|
||||
import type { ChatInputCommandInteraction } from "discord.js"
|
||||
import { t } from "@/utils/i18n"
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("update")
|
||||
.setDescription("Update the member count channel")
|
||||
.setDescriptionLocalizations({ fr: "Mettre à jour le canal de nombre de membres" })
|
||||
|
||||
export async function execute(interaction: ChatInputCommandInteraction) {
|
||||
const guild = interaction.guild
|
||||
if (!guild) return interaction.reply({ content: t(interaction.locale, "common.command_server_only"), flags: MessageFlags.Ephemeral })
|
||||
|
||||
guild.members.fetch().then(async () => {
|
||||
let i = 0
|
||||
guild.members.cache.forEach(member => { if (!member.user.bot) i++ })
|
||||
const channel = guild.channels.cache.get("1091140609139560508")
|
||||
if (!channel) return
|
||||
await channel.setName(`${i} Gens Posés`)
|
||||
return interaction.reply(t(interaction.locale, "salonpostam.update.members_updated", { count: i }))
|
||||
}).catch(console.error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user