This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is the ROUTES.JS | |
const snekfetch = require('snekfetch'); | |
const request = require('request'); | |
const config = require('../config/config.json').token; | |
exports.home = function (req, res) { | |
res.render('home'); | |
}; | |
exports.notFound = function (req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ms = require('ms'); | |
const time = require('moment'); | |
/** | |
* @param {String} time - the unformatted time of the punishment | |
* @param {String} table - what table to look into | |
* @param {String} user - the selected user ID | |
* @param {String} guild - insert the guildID | |
* @param {String} punishment - the punishment for the user | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(async () => { | |
let arr = await r.table('timers').filter({userID : "NONE"}).run(); | |
if (arr[0].inPunishQueue[0]) { | |
for (var i = 0; i < arr[0].inPunishQueue.length; i++) { | |
console.log('Loop started'); | |
let currentUnix = moment().valueOf(); | |
let guildID = arr[0].inPunishQueue[i]['guildID']; | |
let userID = arr[0].inPunishQueue[i]['userID']; | |
let usersUnix = await r.table('timers').filter({ | |
guildID : guildID, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ms = require('ms'); | |
const moment = require('moment'); | |
function punishment(client) { | |
setInterval(async () => { | |
let arr = await r.table('timers').filter({userID : "NONE"}).run(); | |
if (arr[0].inPunishQueue[0]) { | |
for (var i = 0; i < arr[0].inPunishQueue.length; i++) { | |
let guildID = arr[0].inPunishQueue[i]['guildID']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ms = require('ms'); | |
const moment = require('moment'); | |
function punishment(client) { | |
setInterval(async () => { | |
let arr = await r.table('timers').filter({userID : "NONE"}).run(); | |
if (arr[0].inPunishQueue[0]) { | |
for (var i = 0; i < arr[0].inPunishQueue.length; i++) { | |
let guildID = arr[0].inPunishQueue[i]['guildID']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function reminder(client) { | |
setInterval(async () => { | |
/** | |
* @param {String} reminders - the table | |
* @param {String} NONE - the Index value | |
* @param {String} guildID - Table's index | |
*/ | |
let arr = await r.table('reminders').getAll("NONE", {index : "guildID"}).run(); | |
//Check if the array is empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function reminder(client) { | |
setInterval(async () => { | |
/** | |
* @param {String} reminders - the table | |
* @param {String} NONE - the Index value | |
* @param {String} guildID - Table's index | |
*/ | |
let arr = await r.table('reminders').getAll("NONE", {index : "guildID"}).run(); | |
//Check if the array is empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
const Discord = require('discord.js'); | |
const config = require('../config/config.json'); | |
const twitchClass = require('../classes/twitch.js'); | |
const twitch = new twitchClass(config.CLIENTID); | |
exports.run = async (client, msg, args) => { | |
if (!args[0]) { | |
return msg.channel.send('Please give a valid argument.'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: Remove command | |
const twitchClass = require('../classes/twitch.js'); | |
const twitch = new twitchClass(config.CLIENTID); | |
const ms = require('ms') | |
const Discord = require('discord.js'); | |
let check = async (client) => { | |
setInterval(async () => { | |
let queue = await r.table('livestreams').getAll('NONE', {index : 'guildID'}).run(); | |
// If 0 guilds are using the twitch system return. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myClasses = { | |
Sunday: [ | |
'Bible', | |
'Hebrew', | |
'Arabic', | |
'Demostoria', | |
'English', | |
'Literature' | |
], | |
Monday: [ |
OlderNewer