Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // poll.js
- const Discord = require('discord.js'),
- reactions = ['๐ฆ', '๐ง', '๐จ', '๐ฉ', '๐ช', '๐ซ', '๐ฌ', '๐ญ', '๐ฎ', '๐ฏ', '๐ฐ', '๐ฑ', '๐ฒ', '๐ณ', '๐ด', '๐ต', '๐ถ', '๐ท', '๐ธ', '๐น']
- module.exports = {
- run: async (message, args) => {
- if (!message.member.hasPermission('MANAGE_GUILD')) return message.channel.send('Vous n\'avez pas la permission d\'utiliser cette commande.')
- const [question, ...choices] = args.join(' ').split(' | ')
- if (!question) return message.channel.send('Veuillez indiquer la question ร poser.')
- if (!choices.length) return message.channel.send('Veuillez indiquer au moins 1 choix.')
- if (choices.length > 20) return message.channel.send('Il ne peut pas y avoir plus de 20 choix.')
- message.delete()
- const sent = await message.channel.send(new Discord.MessageEmbed()
- .setTitle(question)
- .setDescription(choices.map((choice, i) => `${reactions[i]} ${choice}`).join('\n\n')))
- for (i = 0; i < choices.length; i++) await sent.react(reactions[i])
- },
- name: 'poll',
- guildOnly: true
- }
- // 8ball.js
- const Discord = require('discord.js'),
- replies = ['Oui', 'Non', 'Peut รชtre', 'Evidemment']
- module.exports = {
- run: (message, args) => {
- const question = args.join(' ')
- if (!question) return message.channel.send('Veuillez indiquer une question.')
- message.channel.send(new Discord.MessageEmbed()
- .setTitle(question)
- .setDescription(replies[Math.floor(Math.random() * replies.length)]))
- },
- name: '8ball'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement