'use strict';

const Command = require('../../InlineCommand.js');

/**
 * Make a simple poll
 */
class PollInline extends Command {
  /**
   * Constructs a callable command
   * @param {Genesis} bot The bot object
   */
  constructor(bot) {
    super(bot, 'poll', 'poll:', 'Create a simple poll');
    this.regex = new RegExp('poll\:.+', 'ig');
    this.usages = [
      {
        description: 'Create a simple poll',
        parameters: ['poll statement'],
      },
    ];
  }

  /**
   * Run the command
   * @param {Message} message Message with a command to handle, reply to,
   *                          or perform an action based on parameters.
   */
  async run(message) {
	if (message.channel.permissionsFor(this.bot.client.user.id)
		.has(['USE_EXTERNAL_EMOJIS', 'ADD_REACTIONS'])) {
		message.react('314349398811475968')
			.then(() => {
			  return message.react('314349398824058880');
			})
			.then(() => {
			  return message.react('314349398723264512');
			})
			.catch(this.logger.error);
	}
  }
}

module.exports = PollInline;

@@ -674,17 +674,20 @@
 sage) %7B%0A
-%09
+    
 if (mess
@@ -738,18 +738,22 @@
 ser.id)%0A
-%09%09
+      
 .has(%5B'U
@@ -794,18 +794,22 @@
 S'%5D)) %7B%0A
-%09%09
+      
 message.
@@ -819,32 +819,20 @@
 ct('
-314349398811475968')%0A%09%09%09
+%F0%9F%91%8D')%0A        
 .the
@@ -833,35 +833,40 @@
   .then(() =%3E %7B%0A
-%09%09%09
+        
   return message
@@ -877,39 +877,32 @@
 ct('
-314349398824058880');%0A%09%09%09%7D)%0A%09%09%09
+%F0%9F%91%8E');%0A        %7D)%0A        
 .the
@@ -911,19 +911,24 @@
 () =%3E %7B%0A
-%09%09%09
+        
   return
@@ -947,39 +947,32 @@
 ct('
-314349398723264512');%0A%09%09%09%7D)%0A%09%09%09
+%F0%9F%91%8C');%0A        %7D)%0A        
 .cat
@@ -998,9 +998,12 @@
 r);%0A
-%09
+    
 %7D%0A  

fix trying to use actual external emojis