From 296b71df6bb5d875e6cbf75f71af50d89c190203 Mon Sep 17 00:00:00 2001 From: Tutur33 Date: Thu, 29 Feb 2024 19:12:36 +0100 Subject: [PATCH] add competing --- commands/botcontrol/compet.js | 25 ------------------------- commands/botcontrol/setactivity.js | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 25 deletions(-) delete mode 100644 commands/botcontrol/compet.js diff --git a/commands/botcontrol/compet.js b/commands/botcontrol/compet.js deleted file mode 100644 index ff7ed4c..0000000 --- a/commands/botcontrol/compet.js +++ /dev/null @@ -1,25 +0,0 @@ -const { ActivityType } = require("discord.js"); - -module.exports = { - name: 'competion', - aliases: ['compet'], - description: 'Changer le status du bot en competition', - emote: '🎤', - utilisation: 'compet ', - category: 'botcontrol', - - async execute(message, args, client) { - const streamText = args.join(' ') || 'Streaming'; - const streamURL = 'https://www.twitch.tv/valou336_yt'; - - client.user.setPresence({ - activities: [{ - name: streamText, - type: ActivityType.Competing, - url: streamURL - }] - }); - - message.channel.send(`Le bot est maintenant en compétition : ${streamText}`); - }, -}; \ No newline at end of file diff --git a/commands/botcontrol/setactivity.js b/commands/botcontrol/setactivity.js index 5c3bf65..7541aed 100644 --- a/commands/botcontrol/setactivity.js +++ b/commands/botcontrol/setactivity.js @@ -58,6 +58,12 @@ module.exports = { value: 'watching', description: 'Le bot regarde', emoji: '👀' + }, + { + label: 'Competition', + value: 'competing', + description: 'Le bot participe à', + emoji: '🕹️' } ]); @@ -112,6 +118,14 @@ module.exports = { url: url }] }); + } else if (value === 'competing') { + client.user.setPresence({ + activities: [{ + name: text, + type: ActivityType.Competing, + url: url + }] + }); } else { return; }