Added the message content as a parameter to command.run, re-added message to ban

This commit is contained in:
TheEssem 2020-01-13 10:31:01 -06:00
parent 35cec45196
commit fd3bd96ae6
3 changed files with 7 additions and 7 deletions

View file

@ -8,9 +8,8 @@ exports.run = async (message) => {
try {
await message.channel.guild.banMember(member.id, 0, `ban command used by @${message.author.username}#${message.author.discriminator}`);
return `Successfully banned ${member.mention}.`;
} catch (error) {
throw error;
//return `${message.author.mention}, I was unable to ban the member. Have you given me permissions?`;
} catch (e) {
return `${message.author.mention}, I was unable to ban the member. Have you given me permissions?`;
}
} else {
return `${message.author.mention}, you need to provide a member to ban!`;

View file

@ -1,11 +1,11 @@
const qrcode = require("qrcode");
const stream = require("stream");
exports.run = async (message, args) => {
exports.run = async (message, args, content) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to generate a QR code!`;
message.channel.sendTyping();
const writable = new stream.PassThrough();
qrcode.toFileStream(writable, args.join(" "), { margin: 1 });
qrcode.toFileStream(writable, content, { margin: 1 });
const chunks = [];
writable.on("data", (chunk) => {
chunks.push(chunk);