From f7ec430006c8f21c2aefa99b7b6d4050e20c1fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Gro=C3=9F?= Date: Tue, 7 Nov 2023 15:26:32 +0100 Subject: [PATCH] Migrated dynamic bot status --- .gitignore | 3 ++- timers/botStatus.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 timers/botStatus.js diff --git a/.gitignore b/.gitignore index cf7c602..79ce7fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -config.json \ No newline at end of file +config.json +old/ \ No newline at end of file diff --git a/timers/botStatus.js b/timers/botStatus.js new file mode 100644 index 0000000..4d2afe0 --- /dev/null +++ b/timers/botStatus.js @@ -0,0 +1,15 @@ +const { ActivityType } = require('discord.js'); + +module.exports = { + timeout: 5 * 60 * 1000, + immediate: true, + name: 'Bot Status', + data: { + statusIndex: 0, + animeList: ["K-On!", "Spice and Wolf", "Bakemonogatari", "Your Lie in April", "Noragami", "Puella Magi Madoka Magica", "Akame ga Kill!", "Steins;Gate", "\u3086\u308b\u30ad\u30e3\u30f3\u25b3"] + }, + async tick(client, timer) { + client.user.setActivity(timer.data.animeList[timer.data.statusIndex], { type: ActivityType.Watching }); + timer.data.statusIndex = (timer.data.statusIndex + 1) % timer.data.animeList.length + }, +}; \ No newline at end of file