<commit_before>'use strict';

module.exports = function () {
  this.commands = {};

  var emote = {
    keyword: '&emote',
    desc: 'Replaces your message with a twitch or bttv emote, example: <&emote Kappa>',
    adminOnly: false,
    exec: (payload) => {
      var permissions = payload.message.member.permission.json;
      if (permissions.manageMessages === undefined || permissions.manageMessages === false) {
        App.client.createMessage(payload.message.channel.id,
          "I can't execute this commands, since I dont have permissions to manage messages!"
        );
      }
      App.EmoteRequest.do(payload);
    }
  };

  var help = {
    keyword: '&help',
    desc: 'Lists all commands',
    adminOnly: false,
    exec: (payload) => {
      var resStr = '\n\n HELP: \n```';
      for (var i in App.Commands.commands) {
        var val = App.Commands.commands[i];
        if (val.adminOnly) continue;
        resStr += val.keyword + ' - ' + val.desc + '\n';
      }

      resStr += '```\n\n **Kappa-Chan:** \n Created by: <@105754113572102144> \n GitHub: https://github.com/MergHQ/KappaChan \n';

      App.client.createMessage(payload.message.channel.id, resStr);
    }
  };

  var watchstream = {
    keyword: '&streamnotify',
    desc: 'Sends notification when stream goes live to the channel the command is executed from. <&streamnotify lirik>',
    adminOnly: false,
    exec: (payload) => {
      App.Streamreporter.addStream(payload);
    }
  };

  var unwatchstream = {
    keyword: '&unstreamnotify',
    desc: 'Removes notification from current channel. <&unstreamnotify lirik>',
    adminOnly: false,
    exec: (payload) => {
      App.Streamreporter.removeStream(payload);
    }
  };

  var exec = {
    keyword: '&exec',
    desc: '',
    adminOnly: true,
    exec: (payload) => {
      if (App.config.adminUIDs.indexOf(payload.message.author.id) == -1) return;
      var res = '';
      try {
        /* jshint ignore:start */
        res = eval(payload.parameter.replace('\n', ''));
        /* jshint ignore:end */
        App.client.createMessage(payload.message.channel.id,
          '```' + res + '```'
        );
      } catch (e) {
        App.client.createMessage(payload.message.channel.id,
          '```' + e + '```'
        );
      }
    }
  };

  var bugreport = {
    keyword: '&bug',
    desc: 'Send a bug report.',
    adminOnly: false,
    exec: (payload) => {
      App.Logger.log({username:payload.message.author.username, user_id: payload.message.author.id, message: payload.parameter}, 3);
      App.Logger.log('BUG REPORT (' + payload.message.author.username + ',' + payload.message.channel.name + ',' + payload.message.channel.guild.name + '):    ' + payload.parameter, 2);
    }
  };
<commit_msg>Bug reports with used discriminator<commit_after>'use strict';

module.exports = function () {
  this.commands = {};

  var emote = {
    keyword: '&emote',
    desc: 'Replaces your message with a twitch or bttv emote, example: <&emote Kappa>',
    adminOnly: false,
    exec: (payload) => {
      var permissions = payload.message.member.permission.json;
      if (permissions.manageMessages === undefined || permissions.manageMessages === false) {
        App.client.createMessage(payload.message.channel.id,
          "I can't execute this commands, since I dont have permissions to manage messages!"
        );
      }
      App.EmoteRequest.do(payload);
    }
  };

  var help = {
    keyword: '&help',
    desc: 'Lists all commands',
    adminOnly: false,
    exec: (payload) => {
      var resStr = '\n\n HELP: \n```';
      for (var i in App.Commands.commands) {
        var val = App.Commands.commands[i];
        if (val.adminOnly) continue;
        resStr += val.keyword + ' - ' + val.desc + '\n';
      }

      resStr += '```\n\n **Kappa-Chan:** \n Created by: <@105754113572102144> \n GitHub: https://github.com/MergHQ/KappaChan \n';

      App.client.createMessage(payload.message.channel.id, resStr);
    }
  };

  var watchstream = {
    keyword: '&streamnotify',
    desc: 'Sends notification when stream goes live to the channel the command is executed from. <&streamnotify lirik>',
    adminOnly: false,
    exec: (payload) => {
      App.Streamreporter.addStream(payload);
    }
  };

  var unwatchstream = {
    keyword: '&unstreamnotify',
    desc: 'Removes notification from current channel. <&unstreamnotify lirik>',
    adminOnly: false,
    exec: (payload) => {
      App.Streamreporter.removeStream(payload);
    }
  };

  var exec = {
    keyword: '&exec',
    desc: '',
    adminOnly: true,
    exec: (payload) => {
      if (App.config.adminUIDs.indexOf(payload.message.author.id) == -1) return;
      var res = '';
      try {
        /* jshint ignore:start */
        res = eval(payload.parameter.replace('\n', ''));
        /* jshint ignore:end */
        App.client.createMessage(payload.message.channel.id,
          '```' + res + '```'
        );
      } catch (e) {
        App.client.createMessage(payload.message.channel.id,
          '```' + e + '```'
        );
      }
    }
  };

  var bugreport = {
    keyword: '&bug',
    desc: 'Send a bug report.',
    adminOnly: false,
    exec: (payload) => {
      App.Logger.log({username:payload.message.author.username, user_id: payload.message.author.discriminator, message: payload.parameter}, 3);
      App.Logger.log('BUG REPORT (' + payload.message.author.username + ',' + payload.message.channel.name + ',' + payload.message.channel.guild.name + '):    ' + payload.parameter, 2);
    }
  };

{'fraction_non_alphanumeric': 0.15820841610980677, 'fraction_numerical': 0.007585335018963337, 'mean_word_length': 2.5614147909967846, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '714685', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1745, 'n_words': 386}