-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Ralph
committed
Sep 10, 2021
1 parent
ff1133b
commit ff3dd01
Showing
10 changed files
with
86 additions
and
84 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ node_modules/ | |
# Files | ||
yarn.lock | ||
config.json | ||
package-lock.json | ||
package-lock.json |
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,24 +1,23 @@ | ||
{ | ||
"private": true, | ||
"name": "hastebin-bot", | ||
"version": "0.3.5", | ||
"author": "David Ralph", | ||
"license": "MIT", | ||
"description": "An opensource Discord bot that posts data to Hastebin", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "cd src && node index.js" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/davidjcralph/hastebin-bot/issues" | ||
}, | ||
"homepage": "https://github.com/davidjcralph/hastebin-bot", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/davidjcralph/hastebin-bot" | ||
}, | ||
"dependencies": { | ||
"discord.js": "12.5.1", | ||
"fs": "0.0.1-security" | ||
} | ||
"private": true, | ||
"name": "hastebin-bot", | ||
"version": "0.3.5", | ||
"author": "David Ralph", | ||
"license": "MIT", | ||
"description": "An opensource Discord bot that posts data to Hastebin", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "cd src && node index.js" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/davidjcralph/hastebin-bot/issues" | ||
}, | ||
"homepage": "https://github.com/davidjcralph/hastebin-bot", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/davidjcralph/hastebin-bot" | ||
}, | ||
"dependencies": { | ||
"discord.js": "12.5.1" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
const { MessageEmbed } = require('discord.js'); | ||
|
||
exports.run = (_client, msg) => { | ||
const embed = new MessageEmbed() | ||
.setTitle('Commands:') | ||
.addField('help', 'Returns this message.') | ||
.addField('ping', 'Pong! Returns the bot\'s ping.') | ||
.addField('stats', 'Get the bot stats.') | ||
.addField('haste <text>', 'Upload text to Hastebin.') | ||
.setFooter('Made by davidjcralph | https://github.com/davidjcralph/hastebin-bot'); | ||
msg.channel.send(embed); | ||
const embed = new MessageEmbed() | ||
.setTitle('Commands:') | ||
.addField('help', 'Returns this message.') | ||
.addField('ping', 'Pong! Returns the bot\'s ping.') | ||
.addField('stats', 'Get the bot stats.') | ||
.addField('haste <text>', 'Upload text to Hastebin.') | ||
.setFooter('Made by davidjcralph | https://github.com/davidjcralph/hastebin-bot'); | ||
|
||
msg.channel.send(embed); | ||
}; |
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,3 +1,3 @@ | ||
exports.run = (client, msg) => { | ||
msg.channel.send(`:ping_pong: | Pong! The ping is **${(client.ws.ping)}**ms.`); | ||
msg.channel.send(`:ping_pong: | Pong! The ping is **${(client.ws.ping)}**ms.`); | ||
}; |
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,3 +1,3 @@ | ||
exports.run = (client, msg) => { | ||
msg.channel.send(`:robot: | I am on **${client.guilds.cache.size}** guilds with **${client.users.cache.size}** users!`); | ||
msg.channel.send(`:robot: | I am on **${client.guilds.cache.size}** guilds with **${client.users.cache.size}** users!`); | ||
}; |
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,6 +1,6 @@ | ||
{ | ||
"token": "Discord Bot Token", | ||
"prefix": "hb!", | ||
"hasteurl": "https://hastebin.com", | ||
"dir_uploader": true | ||
"token": "Discord Bot Token", | ||
"prefix": "hb!", | ||
"hasteurl": "https://hastebin.com", | ||
"dir_uploader": true | ||
} |
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,19 +1,19 @@ | ||
module.exports = (client, msg) => { | ||
if (msg.author.bot || msg.content.indexOf(client.config.prefix) !== 0) { | ||
return; | ||
} | ||
if (msg.author.bot || msg.content.indexOf(client.config.prefix) !== 0) { | ||
return; | ||
} | ||
|
||
const args = msg.content.slice(client.config.prefix.length).trim().split(/ +/g); | ||
const cmd = client.commands.get(args.shift().toLowerCase()); | ||
const args = msg.content.slice(client.config.prefix.length).trim().split(/ +/g); | ||
const cmd = client.commands.get(args.shift().toLowerCase()); | ||
|
||
if (!cmd) { | ||
return; | ||
} | ||
if (!cmd) { | ||
return; | ||
} | ||
|
||
try { | ||
cmd.run(client, msg, args); | ||
} catch (e) { | ||
console.log(e); | ||
msg.channel.send(':x: | Something went wrong ```' + e + '```'); | ||
} | ||
try { | ||
cmd.run(client, msg, args); | ||
} catch (e) { | ||
console.log(e); | ||
msg.channel.send(':x: | Something went wrong ```' + e + '```'); | ||
} | ||
}; |
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,3 +1,3 @@ | ||
module.exports = () => { | ||
console.log('Connected to Discord!'); | ||
console.log('Connected to Discord!'); | ||
}; |
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