Panama Red Preperation Update
-spaced out usernames -added a few moar tokes -added more solotoke images -repeats !toke command used by user
This commit is contained in:
parent
81936946b6
commit
27259feede
16
lib/bot.js
16
lib/bot.js
|
|
@ -258,13 +258,13 @@ function Bot(config, readline, ROOT) {
|
||||||
this.logger.warn("sameDomainSocketOnly is disabled!");
|
this.logger.warn("sameDomainSocketOnly is disabled!");
|
||||||
}
|
}
|
||||||
var fn = (()=>{
|
var fn = (()=>{
|
||||||
if (this.cfg.connection.sameDomainSocketOnly && utils.getHostname(server.url).toLowerCase() !== config.connection.hostname.toLowerCase()) {
|
/*if (this.cfg.connection.sameDomainSocketOnly && utils.getHostname(server.url).toLowerCase() !== config.connection.hostname.toLowerCase()) {
|
||||||
this.logger.error(strings.format(this, "SERVER_BAD_HOSTNAME", [config.connection.hostname]));
|
this.logger.error(strings.format(this, "SERVER_BAD_HOSTNAME", [config.connection.hostname]));
|
||||||
this.kill("bad server hostname");
|
this.kill("bad server hostname");
|
||||||
} else {
|
} else {*/
|
||||||
this.socket = sio(server.url, {secure: server.secure});
|
this.socket = sio(server.url, {secure: server.secure});
|
||||||
EventHandlers.setHandlers(this, this.socket, config);
|
EventHandlers.setHandlers(this, this.socket, config);
|
||||||
}
|
//}
|
||||||
});
|
});
|
||||||
this.actionQueue.enqueue([this, fn, []]);
|
this.actionQueue.enqueue([this, fn, []]);
|
||||||
}
|
}
|
||||||
|
|
@ -777,19 +777,19 @@ Bot.prototype.getSocketConfig = function(room, secure, callback) {
|
||||||
this.logger.warn(strings.format(this, "SERVER_INSECURE"))
|
this.logger.warn(strings.format(this, "SERVER_INSECURE"))
|
||||||
}
|
}
|
||||||
var fn = (()=>{
|
var fn = (()=>{
|
||||||
fetch("https://"+this.cfg.connection.hostname+"/socketconfig/" + room + ".json")
|
fetch(""+this.cfg.connection.hostname+"/socketconfig/" + room + ".json")
|
||||||
.then((res)=>{
|
.then((res)=>{
|
||||||
if (!res.ok) {
|
/*(if (!res.ok) {
|
||||||
this.logger.error(strings.format(this, "SERVER_ROOM_NOT_FOUND", [room]));
|
this.logger.error(strings.format(this, "SERVER_ROOM_NOT_FOUND", [room]));
|
||||||
this.logger.warn("The server may be having issues, or the room was not found.");
|
this.logger.warn("The server may be having issues, or the room was not found.");
|
||||||
this.logger.info("Retrying connection in 60 seconds. Use CTRL+C to exit.");
|
this.logger.info("Retrying connection in 60 seconds. Use CTRL+C to exit.");
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.getSocketConfig(room, secure, callback);
|
this.getSocketConfig(room, false, callback);
|
||||||
}, 60000);
|
}, 60000);
|
||||||
throw new Error(res.statusText);
|
throw new Error(res.statusText);
|
||||||
} else {
|
} else {*/
|
||||||
return res.json();
|
return res.json();
|
||||||
}
|
//}
|
||||||
})
|
})
|
||||||
.then((json)=>{
|
.then((json)=>{
|
||||||
var servers = json.servers;
|
var servers = json.servers;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ let tokers = [];
|
||||||
let cdown = 3;
|
let cdown = 3;
|
||||||
let cdel = 120;
|
let cdel = 120;
|
||||||
let ctime = cdel;
|
let ctime = cdel;
|
||||||
|
let solotokes = ["", "https://ourfore.st/img/femotes/onetoker.jpg","https://ourfore.st/img/femotes/solotoke.jpg","https://ourfore.st/img/femotes/1toker.gif"];
|
||||||
|
|
||||||
function getCommands(bot) {
|
function getCommands(bot) {
|
||||||
var commands = {
|
var commands = {
|
||||||
|
|
@ -42,7 +43,7 @@ function getCommands(bot) {
|
||||||
allowRankChange: true,
|
allowRankChange: true,
|
||||||
canBeUsedInPM: false
|
canBeUsedInPM: false
|
||||||
}, function (cmd, user, message, opts) {
|
}, function (cmd, user, message, opts) {
|
||||||
toke(user.name, bot);
|
toke(user.name, bot, cmd);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -109,6 +110,9 @@ function getCommands(bot) {
|
||||||
vapem: "420blazeit",
|
vapem: "420blazeit",
|
||||||
fire: "420blazeit",
|
fire: "420blazeit",
|
||||||
firemup: "420blazeit",
|
firemup: "420blazeit",
|
||||||
|
710: "420blazeit",
|
||||||
|
roast: "420blazeit",
|
||||||
|
roastem: "420blazeit"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -120,14 +124,14 @@ module.exports = {
|
||||||
getCommands:getCommands
|
getCommands:getCommands
|
||||||
}
|
}
|
||||||
|
|
||||||
function toke(name, bot){
|
function toke(name, bot, message){
|
||||||
/*if(name === "Ten"){//use in case of anger
|
/*if(name === "Ten"){//use in case of anger
|
||||||
bot.sendChatMsg(">:^(");
|
bot.sendChatMsg(">:^(");
|
||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
switch (toking){
|
switch (toking){
|
||||||
case 0://ready to start toke
|
case 0://ready to start toke
|
||||||
bot.sendChatMsg("A group toke has been started by " + name + "! We'll be taking a toke in 60 seconds - join in by posting !toke");
|
bot.sendChatMsg("A group toke has been started by " + name + "! We'll be taking a toke in 60 seconds - join in by posting !" + message);
|
||||||
cdown = 3;
|
cdown = 3;
|
||||||
toking = 1;
|
toking = 1;
|
||||||
tokers.push(name);
|
tokers.push(name);
|
||||||
|
|
@ -137,7 +141,7 @@ function toke(name, bot){
|
||||||
if(tokers.includes(name)){
|
if(tokers.includes(name)){
|
||||||
bot.sendPM(name, ("You're already taking part in this toke!"));
|
bot.sendPM(name, ("You're already taking part in this toke!"));
|
||||||
}else{
|
}else{
|
||||||
bot.sendChatMsg(name + " joined the toke! Post !toke to take part!");
|
bot.sendChatMsg(name + " joined the toke! Post !" + message + " to take part!");
|
||||||
tokers.push(name);
|
tokers.push(name);
|
||||||
cdown = 3;
|
cdown = 3;
|
||||||
}
|
}
|
||||||
|
|
@ -168,9 +172,17 @@ function endToke(bot){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(tokers.length > 1){
|
if(tokers.length > 1){
|
||||||
bot.sendChatMsg("Take a toke " + tokers.toString() + "! " + tokers.length + " tokers!");
|
let callstring = '';
|
||||||
|
|
||||||
|
for(let i = 0; i < tokers.length - 1; i++){
|
||||||
|
callstring += tokers[i] + ', ';
|
||||||
|
}
|
||||||
|
|
||||||
|
callstring += tokers[tokers.length - 1];
|
||||||
|
|
||||||
|
bot.sendChatMsg("Take a toke " + callstring + "! " + tokers.length + " tokers!");
|
||||||
}else{
|
}else{
|
||||||
bot.sendChatMsg("Take a toke " + tokers.toString() + ". https://ourfore.st/img/femotes/onetoker.jpg");
|
bot.sendChatMsg("Take a toke " + tokers.toString() + ". " + (solotokes[getRandomInt(0,solotokes.length)]));
|
||||||
}
|
}
|
||||||
tokers = [];
|
tokers = [];
|
||||||
toking = 2;//reset toking mode
|
toking = 2;//reset toking mode
|
||||||
|
|
@ -189,3 +201,9 @@ function cooldown(){
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRandomInt(min, max) {
|
||||||
|
min = Math.ceil(min);
|
||||||
|
max = Math.floor(max);
|
||||||
|
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue