Added override function
This commit is contained in:
parent
921b0690cc
commit
133393bf38
|
|
@ -136,6 +136,18 @@ class Lewd {
|
||||||
const shasum = crypto.createHash('sha256');
|
const shasum = crypto.createHash('sha256');
|
||||||
let rEmbed = new Discord.MessageEmbed();
|
let rEmbed = new Discord.MessageEmbed();
|
||||||
let imgInfo = await this.getRandomEntry(sub);
|
let imgInfo = await this.getRandomEntry(sub);
|
||||||
|
console.log(fs.existsSync('./bot-modules/lewd/override.txt'));
|
||||||
|
if(fs.existsSync('./bot-modules/lewd/override.txt')) {
|
||||||
|
console.log('Override.txt detected. Overriding response');
|
||||||
|
const overrides = fs.readFileSync('./bot-modules/lewd/override.txt').toString();
|
||||||
|
const overrideList = overrides.split('\n');
|
||||||
|
if(overrideList.length > 0) {
|
||||||
|
imgInfo = { 'url' : overrideList[0], 'subreddit' : 'None', 'author': 'None', 'title': 'Custom', 'upvote_ratio':'0.5' };
|
||||||
|
overrideList.shift();
|
||||||
|
const newList = overrideList.join('\n');
|
||||||
|
fs.writeFileSync('./bot-modules/lewd/override.txt', newList);
|
||||||
|
}
|
||||||
|
}
|
||||||
shasum.update(imgInfo.url);
|
shasum.update(imgInfo.url);
|
||||||
const shaHash = shasum.digest('hex').slice(0,9);
|
const shaHash = shasum.digest('hex').slice(0,9);
|
||||||
|
|
||||||
|
|
@ -189,7 +201,7 @@ class Lewd {
|
||||||
async action(msg) {
|
async action(msg) {
|
||||||
let chan = msg.channel;
|
let chan = msg.channel;
|
||||||
if(msg.content.startsWith('!tits')) {
|
if(msg.content.startsWith('!tits')) {
|
||||||
await sendAndLog(chan,'homegrowntits+BigBoobsGW+Boobies+hugehangers+biggerthanyouthought+udders+tittydrop');
|
await this.sendAndLog(chan,'homegrowntits+BigBoobsGW+Boobies+hugehangers+biggerthanyouthought+udders+tittydrop');
|
||||||
} else if (msg.content.startsWith('!booty') || msg.content.startsWith('!ass')) {
|
} else if (msg.content.startsWith('!booty') || msg.content.startsWith('!ass')) {
|
||||||
await this.sendAndLog(chan,'bigasses+pawg+slightcellulite');
|
await this.sendAndLog(chan,'bigasses+pawg+slightcellulite');
|
||||||
} else if (msg.content.startsWith('!thicc')) {
|
} else if (msg.content.startsWith('!thicc')) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
until node main.js; do
|
||||||
|
echo "Server crashed. Respawning..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
Loading…
Reference in New Issue