-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathWaldyBot.js
84 lines (73 loc) · 3.19 KB
/
WaldyBot.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Imported Node Modules
var Discord = require('discord.js');
var client = new Discord.Client();
var richEmbed = new Discord.RichEmbed({ });
var fs = require('fs');
var globalVarsObjs = require('./Objects/GlobalVarsObjects.js');
var helpCommand = require('./Commands/HelpCommand.js');
var setupCommand = require('./Commands/SetupCommand.js');
var pingCommand = require('./Commands/PingCommand.js');
var coolAsciiFaceCommand = require('./Commands/CoolAsciiFaceCommand.js');
var copyPastaCommand = require('./Commands/CopyPastaCommand.js');
var youtubeCommand = require('./Commands/YoutubeCommand.js');
var mediaCommand = require('./Commands/MediaCommands.js')
var hook = new Discord.WebhookClient(); // placeholder
process.setMaxListeners(100);
client.setMaxListeners(100);
// Global Vars:
var packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
var waldyBotVersion = packageJson["version"];
// Discord Authentication Token Variables (Optional)
// Use in place of your tokens (wrapped in a string). Define in the Objects/Auth.js.
// See end of program for placement.
const authToken = globalVarsObjs.authenticationObject.authToken; // WaldyBot
const authTokenBeta = globalVarsObjs.authenticationObject.authTokenBeta; // WaldyBot Beta
// Startup
client.on('ready', () => {
console.log('v' + waldyBotVersion);
console.log('Ready....');
}
);
// WaldyBot's Current Game
var botIsPlaying = 'w help';
client.on('ready', () => {
client.user.setGame(botIsPlaying);
}
);
// Webhooks (placeholder)
// Commands:
// Help
helpCommand.helpFileResponsesObject.helpFileResponsesObjectMethod(client);
// Setup
setupCommand.setUpResponsesObject.setUpResponsesMethod(client);
// Ping/Pong Server Check
pingCommand.pingResponsesObject.pingResponsesMethod(client);
// Cool-Ascii-Face Randomized
coolAsciiFaceCommand.coolAsciiRandomizedObject.coolAsciiRandomized(client);
// Cool-Ascii-Face Keywords/Phrases
coolAsciiFaceCommand.coolAsciiKeywordsPhrasesObject.coolAsciiKeywordsPhrases(client);
// Copypastas Keywords/Phrases
copyPastaCommand.copyPastaKeywordsPhrasesObject.copyPastaKeywordsPhrases(client);
// Youtube Commands
youtubeCommand.youtubeCmdObject.youtubeKeywordsPhrases(client);
youtubeCommand.youtubeCmdObject.youtubeSearch(client);
// Responses:
// Placeholder for Auto-Responses
mediaCommand.mediaResponsesObject.onJoin(client);
mediaCommand.mediaResponsesObject.mediaResponses(client);
mediaCommand.mediaResponsesObject.waldyBotMentionsResponses(client);
// Webhooks TestCmds
client.on('message', message => {
if(message.content === 'w ' + 'webhook test') {
message.channel.send('under construction');
}
});
// WaldyBot Login Token Goes Here: NEVER commmit your WaldyBot's Login Token to public Git/GitHub/Source Control.
// Note on Pre-Made/Integrated Vars
// Vars: authToken, authTokenBeta
// Path of vars is /Objects/Auth.js
// User can edit/add their bot's token in this file. For full future-proof integration.
// No need to re-authenticate/generate the bot's token.
// For ALL Users: "authToken" = Your bot's auth token string.
// For Dev Users: "authTokenBeta" = Local testing instance bot's token.
client.login(authToken); // Your Discord Bot's Auth Token (String) Goes HERE <------------