-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated everything. The commands `kc!vote` and `kc!help` aren't functional right now though.
- Loading branch information
Showing
28 changed files
with
636 additions
and
104 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
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,16 @@ | ||
|
||
const Discord = require('discord.js'); | ||
const { Client, Channel } = require ('discord.js') | ||
const client = new Client(); | ||
|
||
module.exports = { | ||
commands:['clap', 'cheer'], | ||
expectedArgs: '<text>', | ||
minArgs: 1, | ||
callback: (message, arguments, text) => { | ||
let sentence = arguments.join(' 👏 '); | ||
|
||
message.lineReplyNoMention(sentence) | ||
}, | ||
permissions: 'SEND_MESSAGES' | ||
} |
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,30 @@ | ||
const path = require('path') | ||
const fs = require('fs') | ||
|
||
|
||
module.exports = (client) => { | ||
const baseFile = 'command-base.js' | ||
const commandBase = require(`../commands/${baseFile}`) | ||
|
||
const commands = [] | ||
|
||
const readCommands = (dir) => { | ||
const files = fs.readdirSync(path.join(__dirname, dir)) | ||
for (const file of files) { | ||
const stat = fs.lstatSync(path.join(__dirname, dir, file)) | ||
if (stat.isDirectory()) { | ||
readCommands(path.join(dir, file)) | ||
} else if (file !== baseFile && file !== 'load-commands.js') { | ||
const option = require(path.join(__dirname, dir, file)) | ||
commands.push(option) | ||
if (client) { | ||
commandBase(client, option) | ||
} | ||
} | ||
} | ||
} | ||
|
||
readCommands('.') | ||
|
||
return commands | ||
} |
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,50 @@ | ||
const { Client, Channel } = require ('discord.js') | ||
const client = new Client(); | ||
const Discord = require('discord.js') | ||
const { version } = require ('../../config.json') | ||
const { embedIcon } = require ('../../config.json') | ||
|
||
module.exports = { | ||
commands:['vote'], | ||
description: 'Makes an anonymous vote.', | ||
expectedArgs: '<vote>', | ||
minArgs: 1, | ||
callback: async (message, arguments, text) => { | ||
const vote = arguments.join(" ") | ||
var yesCounter = 0 | ||
var noCounter = 0 | ||
const embed = new Discord.MessageEmbed() | ||
.setTitle(`__Anonymous Vote!__`) | ||
.addField(`${vote}\n\n`, `<:upvote:707157967471902731> - ${yesCounter} votes.\n <:downvote:707158001496096808> - ${noCounter} votes.`) | ||
.setColor('#a3ebfb') | ||
.setFooter(`${version}`, embedIcon) | ||
const sentEmbed = await message.channel.send(embed) | ||
await sentEmbed.react('<:upvote:707157967471902731>') | ||
await sentEmbed.react('<:downvote:707158001496096808>') | ||
const filter = (reaction, user) => (['<:upvote:707157967471902731>', '<:downvote:707158001496096808>'].includes(reaction.emoji.name) && !user.bot) | ||
const collector = sentEmbed.createReactionCollector(filter) | ||
|
||
downvotedEmbed = new Discord.MessageEmbed() | ||
.setTitle(`__Anonymous Vote!__`) | ||
.addField(`${vote}\n\n`, `<:upvote:707157967471902731> - ${yesCounter} votes.\n <:downvote:707158001496096808> - ${noCounter +1} votes.`) | ||
.setColor('#a3ebfb') | ||
.setFooter(`${version}`, embedIcon) | ||
upvotedEmbed = new Discord.MessageEmbed() | ||
.setTitle(`__Anonymous Vote!__`) | ||
.addField(`${vote}\n\n`, `<:upvote:707157967471902731> - ${yesCounter +1} votes.\n <:downvote:707158001496096808> - ${noCounter} votes.`) | ||
.setColor('#a3ebfb') | ||
.setFooter(`${version}`, embedIcon) | ||
|
||
collector.on("collect", (reaction, user) => { | ||
switch (reaction.emoji.name) { | ||
case '<:upvote:707157967471902731>': | ||
sentEmbed.edit(upvotedEmbed); | ||
break; | ||
case '<:downvote:707158001496096808>': | ||
sentEmbed.edit(downvotedEmbed); | ||
break; | ||
} | ||
}); | ||
}, | ||
permissions: 'MANAGE_GUILD' | ||
} |
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,17 @@ | ||
const Discord = require('discord.js') | ||
|
||
module.exports = { | ||
commands: ['ban'], | ||
description: 'Bans a member.', | ||
expectedArgs: '<mentionMember> <banReason>', | ||
minArgs: 1, | ||
permissions: 'BAN_MEMBERS', | ||
callback: (message, arguments, text) => { | ||
var memberToBan = message.guild.member(message.mentions.users.first()) | ||
arguments.shift() | ||
var banReason = arguments | ||
memberToBan.ban({reason: `${banReason}`}) | ||
message.lineReplyNoMention(`${memberToBan} has been banned for the reason: \`${banReason}\`.`) | ||
} | ||
|
||
} |
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
Oops, something went wrong.