-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
55 lines (40 loc) · 1.07 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const path = require('path');
const express = require('express');
const ffmpeg = require('fluent-ffmpeg');
const http = require('http');
const Discord = require("discord.js");
var methods = require('./logic/methods.js');
//var auth = require('./auth.json');
const app = express();
//staging
//Main
const MAIN_CHANNEL = process.env.mainchannel;
//Staging
//const MAIN_CHANNEL = auth.mainchannel;
var bot = new Discord.Client({autoReconnect:true});
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);
bot.on('ready', function ()
{
methods.ready(MAIN_CHANNEL,bot);
});
bot.on('guildMemberAdd', function(member)
{
methods.newMember(member)
});
bot.on('presenceUpdate', function(oldMember,newMember)
{
methods.presenceChange(oldMember,newMember);
});
bot.on('message', function (message)
{
methods.message(message);
});
bot.login(process.env.token);
//bot.login(auth.token);