Random status
This commit is contained in:
parent
83ec5aec7a
commit
4b13b17388
|
@ -3,3 +3,4 @@ node_modules/
|
||||||
cookies.txt
|
cookies.txt
|
||||||
config.json
|
config.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
statuses.json
|
13
index.js
13
index.js
|
@ -44,7 +44,18 @@ for (const file of commandFiles) {
|
||||||
|
|
||||||
client.once('ready', () => {
|
client.once('ready', () => {
|
||||||
console.log(`Logged in as ${client.user.tag}!`);
|
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 => {
|
client.on('messageCreate', async message => {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[
|
||||||
|
"Status 1",
|
||||||
|
"Status 2"
|
||||||
|
]
|
Loading…
Reference in New Issue