Skip to content

Instantly share code, notes, and snippets.

View TheOnlyArtz's full-sized avatar
:shipit:
Well Crystal is lit.

Amit Katz TheOnlyArtz

:shipit:
Well Crystal is lit.
View GitHub Profile
//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) {
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
*/
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,
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'];
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'];
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
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
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.');
}
// 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.
const myClasses = {
Sunday: [
'Bible',
'Hebrew',
'Arabic',
'Demostoria',
'English',
'Literature'
],
Monday: [