Skip to content

Commit 12ed8db

Browse files
committed
Changes v1.1.0
- Finished moving commands to their own files. - Created new command statements linking to the required files. - Deleted unused variables and constants. - Deleted redundant variables and comments. - Fixed spelling mistakes and renamed some objects to keep parity with other files. - Fixed some incorrect comments referencing old variables. - v1.1.0 Commit
1 parent f8f3999 commit 12ed8db

File tree

8 files changed

+136
-66
lines changed

8 files changed

+136
-66
lines changed

Commands/CoolAsciiFaceCommand.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
const coolAscii = require('cool-ascii-faces');
2+
const globalVarsObjs = require('../Objects/GlobalVarsObjects.js');
3+
4+
5+
var cmdCoolAscii = globalVarsObjs.commandVarObject.cmdCoolAscii;
6+
var asciiObjs = globalVarsObjs.otherObject.asciiObjsObjs;
7+
8+
// Ascii Responses
9+
// Cool-Ascii-Face Randomized
10+
var coolAsciiRandomized = function(client){
11+
client.on('message', message => {
12+
if(message.content === cmdCoolAscii) {
13+
message.channel.send(coolAscii());
14+
}
15+
});
16+
}
17+
// Cool-Ascii-Face Keywords/Phrases
18+
var coolAsciiKeywordsPhrases = function(client) {
19+
client.on('message', message => {
20+
if(message.content === cmdCoolAscii + ' ' + message.mentions.users.first()) {
21+
message.mentions.users.first().createDM(message.mentions.users.first().send(coolAscii()));
22+
}
23+
if(message.content === cmdCoolAscii + ' ' + 'deal with it') {
24+
message.channel.send(coolAscii.faces[36]);
25+
}
26+
if(message.content === cmdCoolAscii + ' ' + 'raise your dongers') {
27+
message.channel.send(coolAscii.faces[35]);
28+
}
29+
if(message.content === cmdCoolAscii + ' ' + 'syphilis') {
30+
message.channel.send(asciiObjs.syphilis);
31+
}
32+
if(message.content === cmdCoolAscii + ' ' + '$') {
33+
message.channel.send(asciiObjs.$);
34+
}
35+
if(message.content === cmdCoolAscii + ' ' + 'mo money') {
36+
message.channel.send(asciiObjs.momoney);
37+
}
38+
if(message.content === cmdCoolAscii + ' ' + 'hadouken') {
39+
message.channel.send(asciiObjs.hadouken);
40+
}
41+
if(message.content === cmdCoolAscii + ' ' + 'dongerhood') {
42+
message.channel.send(asciiObjs.dongerhood);
43+
}
44+
if(message.content === cmdCoolAscii + ' ' + 'die a dodger') {
45+
message.channel.send(asciiObjs.dieadodger);
46+
}
47+
if(message.content === cmdCoolAscii + ' ' + 'feeding') {
48+
message.channel.send(asciiObjs.feeding);
49+
}
50+
});
51+
}
52+
53+
// Objects
54+
var coolAsciiRandomizedObject = {
55+
coolAsciiRandomized: coolAsciiRandomized
56+
}
57+
58+
var coolAsciiKeywordsPhrasesObject = {
59+
coolAsciiKeywordsPhrases: coolAsciiKeywordsPhrases
60+
}
61+
62+
var exportobject = {
63+
coolAsciiRandomizedObject: coolAsciiRandomizedObject,
64+
coolAsciiKeywordsPhrasesObject: coolAsciiKeywordsPhrasesObject
65+
}
66+
67+
module.exports = exportobject;

Commands/CopyPastaCommand.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const globalVarsObjs = require('../Objects/GlobalVarsObjects.js');
2+
3+
4+
var cmdCopyPasta = globalVarsObjs.commandVarObject.cmdCopyPasta;
5+
var copyPastaObjs = globalVarsObjs.otherObject.copyPastaObjsObjs;
6+
7+
// CopyPasta Responses
8+
// Copypastas Keywords/Phrases
9+
var copyPastaKeywordsPhrases = function(client) {
10+
client.on('message', message => {
11+
if(message.content === cmdCopyPasta + ' ' + 'im syliris') {
12+
message.channel.send(copyPastaObjs.imsyliris);
13+
}
14+
});
15+
}
16+
17+
// Objects
18+
var copyPastaKeywordsPhrasesObject = {
19+
copyPastaKeywordsPhrases: copyPastaKeywordsPhrases
20+
}
21+
22+
var exportobject = {
23+
copyPastaKeywordsPhrasesObject: copyPastaKeywordsPhrasesObject
24+
}
25+
module.exports = exportobject;

Objects/ASCIIObjects.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var object1 = {
1+
var asciiObject = {
22
syphilis: '༼ つ ◕_◕ ༽つ SYLIRIS GIVE ME SYPHILIS ༼ つ ◕_◕ ༽つ',
33
$: '[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅] CASH MONEY [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]',
44
momoney: '[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅] Mo\' money, mo\' Dongers [̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅]',
@@ -7,4 +7,8 @@ var object1 = {
77
dieadodger: '༼ ºل͟º༼ ºل͟º༼ ºل͟º༼ ºل͟º ༽ºل͟º ༽ºل͟º ༽You either die a DODGER, or fill long enough to become the SUPPORT༼ ºل͟º༼ ºل͟º༼ ºل͟º༼ ºل͟º ༽ºل͟º ༽ºل͟º ༽',
88
feeding: 'ᕙ༼ຈل͜ຈ༽ᕗ. FEEDING, FEEDING, FEEDING, FEEDING.ᕙ༼ຈل͜ຈ༽ᕗ'
99
}
10-
module.exports = object1;
10+
11+
var exportobject = {
12+
asciiObject: asciiObject,
13+
}
14+
module.exports = exportobject;

Objects/CopyPastaObjects.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
var object1 = {
1+
var copyPastaObject = {
22
imsyliris: 'I’m Syliris and this is my syphilis. I work here with my STD’s and my boosted teammates, Jordan and The Argonauts, and in 5 months I’ve learned one thing. You never know what is gonna come through that champ select.'
33
}
4-
module.exports = object1;
4+
5+
var exportobject = {
6+
copyPastaObject: copyPastaObject
7+
}
8+
9+
module.exports = exportobject;

Objects/GlobalVarsObjects.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
const authFile = require('../Objects/Auth.js');
2-
const helpObjs = require('../Objects/HelpObjects.js');
1+
const authFile = require('./Auth.js');
2+
const helpObjs = require('./HelpObjects.js');
3+
const asciiObjs = require('./ASCIIObjects.js');
4+
const copyPastaObjs = require('./CopyPastaObjects.js');
35

46

57
// Global Vars
@@ -28,6 +30,10 @@ var waldyBotAuthUrl = authFile.waldyBotAuthUrlObj.waldyBotAuthUrlString;
2830
var authToken = authFile.discordTokensObject.DiscordToken; // WaldyBot
2931
var authTokenBeta = authFile.discordTokensObject.DiscordTokenBeta; // WaldyBot Beta
3032

33+
// Other Objects
34+
var asciiObjsObjs = asciiObjs.asciiObject;
35+
var copyPastaObjsObjs = copyPastaObjs.copyPastaObject;
36+
3137
// Objects
3238
var globalVarObject = {
3339
waldyBot: waldyBot,
@@ -39,6 +45,11 @@ var filesObject = {
3945
setUpFile: setUpFile
4046
}
4147

48+
var otherObject = {
49+
asciiObjsObjs: asciiObjsObjs,
50+
copyPastaObjsObjs: copyPastaObjsObjs
51+
}
52+
4253
var authenticationObject = {
4354
waldyBotAuthUrl: waldyBotAuthUrl,
4455
authToken: authToken,
@@ -62,6 +73,7 @@ var commandVarObject = {
6273
var exportobject = {
6374
globalVarObject: globalVarObject,
6475
filesObject: filesObject,
76+
otherObject: otherObject,
6577
authenticationObject: authenticationObject,
6678
commandVarObject: commandVarObject
6779
}

Objects/HelpObjects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var cmdSetUpInstallHelp = 'w setup install\n\t ' + 'Requests my server authentic
77
var cmdPing = 'w ' + 'ping';
88
var cmdPingHelp = 'w ping\n\t ' + 'Checks my current online/offline status.';
99
var cmdCoolAscii = 'w ' + 'ascii';
10-
var cmdCoolAsciiHelp = 'w ascii\n\t ' + 'Returns a randomized Ascii face.ヽ༼ຈل͜ຈ༽ノ\n\t ' + 'Cmd is modified with postfixed keywords/phrases following a single space.\n\t ' + 'Keywords: @mention, deal with it, raise your dongers, syphilis, $, mo\' money, hadouken, dongerhood, die a dodger, feeding';
10+
var cmdCoolAsciiHelp = 'w ascii\n\t ' + 'Returns a randomized Ascii face.ヽ༼ຈل͜ຈ༽ノ\n\t ' + 'Cmd is modified with postfixed keywords/phrases following a single space.\n\t ' + 'Keywords: @mention, deal with it, raise your dongers, syphilis, $, mo money, hadouken, dongerhood, die a dodger, feeding';
1111
var cmdCopyPasta = 'w ' + 'copypasta';
1212
var cmdCopyPastaHelp = 'w copypasta\n\t ' + 'Returns copypastas.\n\t ' + 'Cmd is modified with postfixed keywords/phrases following a single space.\n\t ' + 'Keywords: im syliris';
1313

WaldyBot.js

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
const Discord = require('discord.js');
22
const client = new Discord.Client();
3-
const coolAscii = require('cool-ascii-faces');
4-
const asciiObjs = require('./Objects/ASCIIObjects.js');
5-
const copyPastaObjs = require('./Objects/CopyPastaObjects.js');
6-
const helpObjs = require('./Objects/HelpObjects.js');
3+
const fs = require('fs');
74
const globalVarsObjs = require('./Objects/GlobalVarsObjects.js');
85
const helpCommand = require('./Commands/HelpCommand.js');
96
const setupCommand = require('./Commands/SetupCommand.js');
107
const pingCommand = require('./Commands/PingCommand.js');
11-
const hook = new Discord.WebhookClient();
8+
const coolAsciiFaceCommand = require('./Commands/CoolAsciiFaceCommand.js');
9+
const copyPastaCommand = require('./Commands/CopyPastaCommand.js');
10+
const hook = new Discord.WebhookClient(); // placeholder
1211

1312
process.setMaxListeners(0);
1413

1514

1615
// Global Vars
17-
const waldyBot = globalVarsObjs.globalVarObject.waldyBot;
18-
const waldyBotBeta = globalVarsObjs.globalVarObject.waldyBotBeta;
16+
var packageJson = { };
17+
fs.readFile('./package.json', function(data){
18+
return packageJson = data;
19+
});
20+
const waldyBotVersion = packageJson["version"];
1921
const authToken = globalVarsObjs.authenticationObject.authToken; // WaldyBot
2022
const authTokenBeta = globalVarsObjs.authenticationObject.authTokenBeta; // WaldyBot Beta
2123

2224

2325
// Startup
2426
client.on('ready', () => {
2527
console.log('Ready....');
28+
console.log(waldyBotVersion);
2629
}
2730
);
2831

@@ -34,14 +37,7 @@ client.on('ready', () => {
3437
}
3538
);
3639

37-
// Webhooks
38-
39-
// Command Vars w/Help Descriptions;
40-
var cmdCoolAscii = helpObjs.cmdVarObject.cmdCoolAscii;
41-
var cmdCoolAsciiHelp = helpObjs.cmdVarObject.cmdCoolAsciiHelp;
42-
var cmdCopyPasta = helpObjs.cmdVarObject.cmdCopyPasta;
43-
var cmdCopyPastaHelp = helpObjs.cmdVarObject.cmdCopyPastaHelp;
44-
40+
// Webhooks (placeholder)
4541

4642
// Commands:
4743
// Help
@@ -51,56 +47,17 @@ setupCommand.setUpResponsesObject.setUpResponsesMethod(client);
5147
// Ping/Pong Server Check
5248
pingCommand.pingResponsesObject.pingResponsesMethod(client);
5349
// Cool-Ascii-Face Randomized
54-
client.on('message', message => {
55-
if(message.content === cmdCoolAscii) {
56-
message.send(coolAscii());
57-
}
58-
});
50+
coolAsciiFaceCommand.coolAsciiRandomizedObject.coolAsciiRandomized(client);
5951
// Cool-Ascii-Face Keywords/Phrases
60-
client.on('message', message => {
61-
if(message.content === cmdCoolAscii + ' ' + message.mentions.users.first()) {
62-
message.mentions.users.first().createDM(message.mentions.users.first().send(coolAscii()));
63-
}
64-
if(message.content === cmdCoolAscii + ' ' + 'deal with it') {
65-
message.channel.send(coolAscii.faces[36]);
66-
}
67-
if(message.content === cmdCoolAscii + ' ' + 'raise your dongers') {
68-
message.channel.send(coolAscii.faces[35]);
69-
}
70-
if(message.content === cmdCoolAscii + ' ' + 'syphilis') {
71-
message.channel.send(asciiObjs.syphilis);
72-
}
73-
if(message.content === cmdCoolAscii + ' ' + '$') {
74-
message.channel.send(asciiObjs.$);
75-
}
76-
if(message.content === cmdCoolAscii + ' ' + 'mo\' money') {
77-
message.channel.send(asciiObjs.momoney);
78-
}
79-
if(message.content === cmdCoolAscii + ' ' + 'hadouken') {
80-
message.channel.send(asciiObjs.hadouken);
81-
}
82-
if(message.content === cmdCoolAscii + ' ' + 'dongerhood') {
83-
message.channel.send(asciiObjs.dongerhood);
84-
}
85-
if(message.content === cmdCoolAscii + ' ' + 'die a dodger') {
86-
message.channel.send(asciiObjs.dieadodger);
87-
}
88-
if(message.content === cmdCoolAscii + ' ' + 'feeding') {
89-
message.channel.send(asciiObjs.feeding);
90-
}
91-
});
52+
coolAsciiFaceCommand.coolAsciiKeywordsPhrasesObject.coolAsciiKeywordsPhrases(client);
9253
// Copypastas Keywords/Phrases
93-
client.on('message', message => {
94-
if(message.content === cmdCopyPasta + ' ' + 'im syliris') {
95-
message.channel.send(copyPastaObjs.imsyliris);
96-
}
97-
});
54+
copyPastaCommand.copyPastaKeywordsPhrasesObject.copyPastaKeywordsPhrases(client);
9855
// Webhooks TestCmds
9956
client.on('message', message => {
10057
if(message.content === 'w ' + 'webhook test') {
10158
message.channel.send('under construction');
10259
}
10360
});
10461

105-
// WaldyBot Login Token Goes Here: For local testing use tokenBeta.
62+
// WaldyBot Login Token Goes Here: For local testing use authTokenBeta.
10663
client.login(authToken);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WaldyBot",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "WaldyBot",
55
"main": "WaldyBot.js",
66
"scripts": {

0 commit comments

Comments
 (0)