more playing statuses and moving playing stats to a util

This commit is contained in:
ry 2020-01-09 18:38:31 +01:00
parent bdb87c97d7
commit 0ddc8e064f
2 changed files with 126 additions and 47 deletions

View file

@ -1,50 +1,12 @@
const { log } = require('../utils');
const {
log,
status
} = require('../utils');
const config = require('../config');
const blapi = require('blapi');
//blapi.setLogging(true);
function randomStatus(client) {
const States = [
{
activity: {
name: 'server fans whirr 💨',
type: 'LISTENING'
},
status: 'online'
},
{
activity: {
name: 'True Damage - GIANTS',
type: 'LISTENING'
},
status: 'online'
},
{
activity: {
name: `${client.guilds.size} Servers -w-`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: 'Δ & ♫',
type: 'LISTENING'
},
status: 'online'
},
{
activity: {
name: `'help | thaldr.in`,
type: 'WATCHING'
},
status: 'online'
}
// { game: { name: `over ${thal.users.get('318044130796109825').username}~`, type: 'WATCHING' }, status: 'dnd' }
];
let status = States[~~(Math.random() * States.length)];
return client.user.setPresence(status);
}
module.exports = {
name: 'ready',
@ -53,7 +15,7 @@ module.exports = {
blapi.handle(client, config.apis);
}
log.hasStarted();
randomStatus(client);
status.randomStatus(client)
setInterval(() => {
randomStatus(client);
}, 60000);

View file

@ -1,6 +1,123 @@
const States = [{
activity: {
name: 'server fans whirr 💨',
type: 'LISTENING'
},
status: 'online'
},
{
activity: {
name: 'True Damage - GIANTS',
type: 'LISTENING'
},
status: 'online'
},
{
activity: {
name: `${client.guilds.size} Servers -w-`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: 'Δ & ♫',
type: 'LISTENING'
},
status: 'online'
},
{
activity: {
name: `'help | thaldr.in`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `Linux Servers`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `e621 Videos`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `WannaCry`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `the Blockchain!`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `something... ;3`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `Skynet`,
type: 'WATCHING'
},
status: 'online'
},
{
activity: {
name: `Half Life`,
type: 'PLAYING'
},
status: 'online'
},
{
activity: {
name: `Half Life 2`,
type: 'PLAYING'
},
status: 'online'
},
{
activity: {
name: `Portal`,
type: 'PLAYING'
},
status: 'online'
},
{
activity: {
name: `Portal 2`,
type: 'PLAYING'
},
status: 'online'
}
// { game: { name: `over ${thal.users.get('318044130796109825').username}~`, type: 'WATCHING' }, status: 'dnd' }
];
function randomStatus(client) {
let status = States[~~(Math.random() * States.length)];
return client.user.setPresence(status);
}
module.exports = {
playing: "PLAYING",
watching: "WATCHING",
listening: "LISTENING",
streaming: "STREAMING"
streaming: "STREAMING";
randomStatus
};