From 0ddc8e064f69484688d8b207aba04654ef64f752 Mon Sep 17 00:00:00 2001 From: ry Date: Thu, 9 Jan 2020 18:38:31 +0100 Subject: [PATCH] more playing statuses and moving playing stats to a util --- DiscordEvents/ready.js | 52 +++--------------- utils/src/statuses.js | 121 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 126 insertions(+), 47 deletions(-) diff --git a/DiscordEvents/ready.js b/DiscordEvents/ready.js index bbc3cdb..37d02df 100755 --- a/DiscordEvents/ready.js +++ b/DiscordEvents/ready.js @@ -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,9 +15,9 @@ module.exports = { blapi.handle(client, config.apis); } log.hasStarted(); - randomStatus(client); + status.randomStatus(client) setInterval(() => { randomStatus(client); }, 60000); } -}; +}; \ No newline at end of file diff --git a/utils/src/statuses.js b/utils/src/statuses.js index a713cac..aab7090 100755 --- a/utils/src/statuses.js +++ b/utils/src/statuses.js @@ -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 +}; \ No newline at end of file