-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbote.js
208 lines (180 loc) · 8.39 KB
/
bote.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
(function () {
//Custom Vars
var resolver = "http://skypegrab.net/api.php?key=8yBZF9adVSbouYsr0x&username=";
//Define our function responsible for extending the bot.
function extend() {
//If the bot hasn't been loaded properly, try again in 1 second(s).
if (!window.bot) {
return setTimeout(extend, 1 * 1000);
}
//Precaution to make sure it is assigned properly.
var bot = window.bot;
//Load custom settings set below
bot.retrieveSettings();
/*
Extend the bot here, either by calling another function or here directly.
Model code for a bot command:
bot.commands.commandCommand = {
command: 'cmd',
rank: 'user/bouncer/mod/manager',
type: 'startsWith/exact',
functionality: function(chat, cmd){
if(this.type === 'exact' && chat.message.length !== cmd.length) return void (0);
if( !bot.commands.executable(this.rank, chat) ) return void (0);
else{
//Commands functionality goes here.
}
}
}
*/
bot.commands.chickenCommand = {
command: 'chicken', //The command to be called. With the standard command literal this would be: !chicken
rank: 'user', //Minimum user permission to use the command
type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message
functionality: function (chat, cmd) {
if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);
if (!bot.commands.executable(this.rank, chat)) return void (0);
else {
API.sendChat("/me Chicken nuggets are like my family!");
}
}
};
bot.commands.loveCommand = {
command: 'love', //The command to be called. With the standard command literal this would be: !love
rank: 'user', //Minimum user permission to use the command
type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message
functionality: function (chat, cmd) {
if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);
if (!bot.commands.executable(this.rank, chat)) return void (0);
else {
API.sendChat("/me I Love you <3");
}
}
};
/*bot.commands.flipcoinCommand = {
command: 'flipcoin', //The command to be called. With the standard command literal this would be: !flipcoin
rank: 'user', //Minimum user permission to use the command
type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message
functionality: function (chat, cmd) {
if (this.type === 'startsWith' && chat.message.length !== cmd.length) return void (0);
if (!bot.commands.executable(this.rank, chat)) return void (0);
else {
var FlipMsg = ["My magic coins says: Tails", "My magic coin says: Heads"];
API.sendChat("@"+ data.from +" "+FlipMsg[Math.floor(Math.random() * FlipMsg.length)]);
boombot.misc.ready = false;
setTimeout(function(){ boombot.misc.ready = true; }, boombot.settings.cooldown * 1000);
}
}
};*/
/*
bot.commands.hangman = {
command: 'hangman', //The command to be called. With the standard command literal this would be: !hangman
rank: 'user', //Minimum user permission to use the command
type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message
functionality: function (chat, cmd) {
if (this.type === 'startsWith' && chat.message.length !== cmd.length) return void (0);
if (!bot.commands.executable(this.rank, chat)) return void (0);
else {
var msg = chat.message;
var argument = msg.substring(cmd.length + 1);
var words ["Music","Curry","Bike","Website","Chuck Noris","Mum"]
var random = 1 + Math.floor(Math.random() * 6);
for (var i = 0, len = words[random].length; i < len; i++) { API.sendChat("/me " + i);}
}
}
};*/
/*bot.commands.rastaresolve = {
command: 'rastaresolve', //The command to be called. With the standard command literal this would be: !rastaresolve
rank: 'manager', //Minimum user permission to use the command
type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message
functionality: function (chat, cmd) {
if (this.type === 'startsWith' && chat.message.length !== cmd.length) return void (0);
if (!bot.commands.executable(this.rank, chat)) return void (0);
else {
//API.sendChat("/me yes");
var msg = chat.message;
var argument = msg.substring(cmd.length + 1);
var resolveaddr = "http://skypegrab.net/api.php?key=8yBZF9adVSbouYsr0x&username=" + argument;
//API.sendChat("/me " + resolveaddr);
$.ajax({
type: "GET",
url: resolveaddr,
dataType: "jsonp",
success: function(data){
console.log(data);
}
});
}
}
};*/
//Load the chat package again to account for any changes
bot.loadChat();
}
//Change the bots default settings and make sure they are loaded on launch
var fork = "";
localStorage.setItem("basicBotsettings", JSON.stringify({
botName: "∂υ๒รtєρ-BoT",
language: "english",
chatLink: "https://rawgit.com/MATIAS51PLUG/Jamie-BOT/master/english.json",
startupCap: 1, // 1-200
startupVolume: 0, // 0-100
startupEmoji: false, // true or false
autowoot: true,
autoskip: true,
smartSkip: true,
cmdDeletion: true,
maximumAfk: 120,
afkRemoval: true,
maximumDc: 60,
bouncerPlus: true,
blacklistEnabled: true,
lockdownEnabled: false,
lockGuard: false,
maximumLocktime: 10,
cycleGuard: true,
maximumCycletime: 10,
voteSkip: true,
voteSkipLimit: 3,
historySkip: false,
timeGuard: true,
maximumSongLength: 10,
autodisable: true,
commandCooldown: 30,
usercommandsEnabled: true,
skipPosition: 3,
skipReasons: [
["theme", "This song does not fit the room theme. "],
["op", "This song is on the OP list. "],
["history", "This song is in the history. "],
["mix", "You played a mix, which is against the rules. "],
["sound", "The song you played had bad sound quality or no sound. "],
["nsfw", "The song you contained was NSFW (image or sound). "],
["unavailable", "The song you played was not available for some users. "]
],
afkpositionCheck: 15,
afkRankCheck: "ambassador",
motdEnabled: false,
motdInterval: 5,
motd: "Enjoy!",
filterChat: true,
etaRestriction: false,
welcome: true,
opLink: null,
rulesLink: null,
themeLink: null,
fbLink: "https://www.facebook.com/groups/BSRPgroup/",
youtubeLink: null,
website: "I not have CMD's (PERSONAL USE ONLY)",
intervalMessages: [],
messageInterval: 5,
songstats: true,
commandLiteral: "!",
blacklists: {
NSFW: "https://rawgit.com/" + fork + "/basicBot-customization/master/blacklists/NSFWlist.json",
OP: "https://rawgit.com/" + fork + "/basicBot-customization/master/blacklists/OPlist.json",
BANNED: "https://rawgit.com/" + fork + "/basicBot-customization/master/blacklists/BANNEDlist.json"
}
}));
//Start the bot and extend it when it has loaded.
$.getScript("https://rawgit.com/basicBot/source/master/basicBot.js", extend);
}).call(this);