This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Random changes & almost done with MySQL integration
- Loading branch information
1 parent
24d7d2d
commit a3ab8e9
Showing
158 changed files
with
28,220 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
node index.js | ||
node bot.js | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"ERR_MSG":"Sorry, unknown command!","DEFAULT_UI_COLOR":"0xFF4000","SERVER_POINTS_UI_COLOR":"0xFFBD33","BOT_NAME":"Cylbot","BOT_VERSION":"v1.0.0","BOT_DESCRIPTION":"Cylbot is a unique multi-use Discord bot.","COMMAND_COOLDOWN":1,"POINTS_COOLDOWN":300,"MAX_WORK_AMOUNT":7} | ||
{"ERR_MSG":"Sorry, unknown command!","DEFAULT_UI_COLOR":"0xFF4000","SERVER_POINTS_UI_COLOR":"0x00D2FF","SERVER_POINTS":"Cylbot Xels","SERVER_POINTS_NAME":"Xels","BOT_NAME":"Cylbot","BOT_VERSION":"v1.2.0","BOT_DESCRIPTION":"Cylbot is a unique multi-use Discord bot.","COMMAND_COOLDOWN":1,"POINTS_COOLDOWN":300,"MAX_WORK_AMOUNT":7} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const Discord = require("discord.js"); | ||
let scavengeCooldown = new Set() | ||
|
||
module.exports = class test { | ||
constructor(){ | ||
this.name = 'scavenge', | ||
this.alias = ['scavenge'] | ||
this.usage = ';scavenge' | ||
} | ||
|
||
async run(bot, message, args, connection) { | ||
if (scavengeCooldown.has(message.author.id)) { | ||
message.reply("You must wait for the scavenge cooldown to end (5 minutes)!") | ||
return | ||
} else { | ||
const botConfig = require("./../bot-config.json") | ||
let pointsAmt = Math.floor(Math.random() * botConfig.MAX_WORK_AMOUNT) + 1; | ||
connection.query(`SELECT * FROM points WHERE id = '${message.author.id}'`, (err, rows) => { | ||
if (err) throw err | ||
let sql | ||
if (rows.length < 1) { | ||
sql = `INSERT INTO points(id, points) VALUES ('${message.author.id}', ${pointsAmt})` | ||
} else { | ||
let points = rows[0].points | ||
sql = ` UPDATE points SET points = ${points + pointsAmt} WHERE id = '${message.author.id}'` | ||
} | ||
connection.query(sql) | ||
}) | ||
var embed = new Discord.RichEmbed() | ||
.setColor(botConfig.SERVER_POINTS_UI_COLOR) | ||
.setTitle(`**${bot.emojis.get("675022811395260433")} ${botConfig.SERVER_POINTS} ${bot.emojis.get("675022811395260433")}**`) | ||
.setDescription(`${message.author} just scavenged for **${pointsAmt}** ${botConfig.SERVER_POINTS_NAME}!`) | ||
message.channel.send(embed); | ||
scavengeCooldown.add(message.author.id) | ||
setTimeout(() => { | ||
scavengeCooldown.delete(message.author.id) | ||
}, botConfig.POINTS_COOLDOWN * 1000) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.