Random status

This commit is contained in:
Wizzard 2024-08-17 17:45:26 -04:00
parent 83ec5aec7a
commit 4b13b17388
3 changed files with 18 additions and 2 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@ utils/tmp/
node_modules/
cookies.txt
config.json
package-lock.json
package-lock.json
statuses.json

View File

@ -44,7 +44,18 @@ for (const file of commandFiles) {
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity('DZ Politics', { type: 'LISTENING' });
client.user.setStatus('idle');
const statuses = require('./statuses.json');
function updateStatus() {
const randomStatus = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(randomStatus);
console.log(`Activity set to: ${randomStatus}`);
}
updateStatus();
setInterval(updateStatus, 30000);
});
client.on('messageCreate', async message => {

4
statuses.json.example Normal file
View File

@ -0,0 +1,4 @@
[
"Status 1",
"Status 2"
]