summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/server/poll.ts41
-rw-r--r--src/commands/utility/time.ts23
2 files changed, 64 insertions, 0 deletions
diff --git a/src/commands/server/poll.ts b/src/commands/server/poll.ts
new file mode 100644
index 0000000..eb91e5f
--- /dev/null
+++ b/src/commands/server/poll.ts
@@ -0,0 +1,41 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import { MessageEmbed } from 'discord.js';
+import emoji from 'emoji-random'
+
+module.exports = class PollServer extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'poll',
+ group: 'server',
+ memberName: 'poll',
+ description: 'Make a poll.',
+ examples: ['uwu!poll am i cool?'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ guildOnly: true
+ });
+ }
+ run(msg: CommandoMessage) {
+ let messageArray = msg.content.split(' ')
+ let args = messageArray.slice(1)
+
+ if (!args || args.length < 1) {
+ msg.reply(`No poll content was specified. ${emoji.random()}`)
+ } else {
+ let emb = new MessageEmbed()
+ .setColor(0xFFCC4D)
+ .setFooter('React to vote.')
+ .setDescription(args.join(' '))
+ .setTitle(`Poll Created by ${msg.author.username} ${emoji.random()}`)
+ msg.say(emb).then(fMsg => {
+ fMsg.react('✅')
+ fMsg.react('❎')
+ msg.delete({ timeout: 1000 })
+ })
+ }
+ }
+}; \ No newline at end of file
diff --git a/src/commands/utility/time.ts b/src/commands/utility/time.ts
new file mode 100644
index 0000000..5bcf892
--- /dev/null
+++ b/src/commands/utility/time.ts
@@ -0,0 +1,23 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random'
+
+module.exports = class TimeUtility extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'time',
+ group: 'utility',
+ memberName: 'time',
+ description: 'Check the time.',
+ examples: ['uwu!time'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ });
+ }
+ run(msg: CommandoMessage) {
+ msg.reply(`The time is currently **${new Date()}**.`)
+ }
+}; \ No newline at end of file