How to use the monochrome-bot.Permissions.attachFiles function in monochrome-bot

To help you get started, we’ve selected a few monochrome-bot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mistval / kotoba / src / discord_commands / quiz.js View on Github external
},
      false,
      'Shutdown scheduled',
    );
  }
}

module.exports = {
  commandAliases: ['quiz', 'readingQuiz', 'starttest', 'startquiz', 'rt', 'rq', 'q'],
  aliasesForHelp: ['quiz', 'q'],
  canBeChannelRestricted: true,
  uniqueId: 'readingQuiz14934',
  cooldown: 1,
  shortDescription: 'See how to start a quiz in this channel.',
  longDescription: helpLongDescription,
  requiredBotPermissions: [Permissions.attachFiles, Permissions.embedLinks, Permissions.sendMessages],
  requiredSettings: quizManager.getDesiredSettings().concat([
    'quiz/japanese/conquest_and_inferno_enabled',
    'quiz/japanese/internet_decks_enabled',
  ]),
  attachIsServerAdmin: true,
  async action(bot, msg, suffix, monochrome, serverSettings) {
    let suffixReplaced = suffix.replace(/ *\+ */g, '+').replace(/ *-mc/g, '-mc').trim();
    suffixReplaced = suffixReplaced.toLowerCase();
    const messageSender = new DiscordMessageSender(bot, msg);
    const masteryEnabled = serverSettings['quiz/japanese/conquest_and_inferno_enabled'];
    const internetDecksEnabled = serverSettings['quiz/japanese/internet_decks_enabled'];

    const isMastery = msg.extension === MASTERY_EXTENSION
      || suffixReplaced.indexOf(MASTERY_NAME) !== -1;
    const isConquest = !isMastery
      && (msg.extension === CONQUEST_EXTENSION || suffixReplaced.indexOf(CONQUEST_NAME) !== -1);
github mistval / kotoba / bot / src / discord_commands / quiz.js View on Github external
throw new FulfillmentError({
      publicMessage: messageContent,
      logDescription: 'Shutdown scheduled',
    });
  }
}

module.exports = {
  commandAliases: ['quiz', 'readingQuiz', 'starttest', 'startquiz', 'rt', 'rq', 'q'],
  aliasesForHelp: ['quiz', 'q'],
  canBeChannelRestricted: true,
  uniqueId: 'readingQuiz14934',
  cooldown: 1,
  shortDescription: 'See how to start a quiz in this channel.',
  longDescription: helpLongDescription,
  requiredBotPermissions: [Permissions.attachFiles, Permissions.embedLinks, Permissions.sendMessages],
  requiredSettings: quizManager.getDesiredSettings().concat([
    'quiz/japanese/conquest_and_inferno_enabled',
    'quiz/japanese/internet_decks_enabled',
  ]),
  attachIsServerAdmin: true,
  async action(bot, msg, suffix, monochrome, serverSettings) {
    let suffixReplaced = suffix.replace(/ *\+ */g, '+').replace(/ *-mc/g, '-mc').trim();
    suffixReplaced = suffixReplaced.toLowerCase();
    const messageSender = new DiscordMessageSender(bot, msg);
    const masteryEnabled = serverSettings['quiz/japanese/conquest_and_inferno_enabled'];
    const internetDecksEnabled = serverSettings['quiz/japanese/internet_decks_enabled'];

    const isMastery = msg.extension === MASTERY_EXTENSION
      || suffixReplaced.indexOf(MASTERY_NAME) !== -1;
    const isConquest = !isMastery
      && (msg.extension === CONQUEST_EXTENSION || suffixReplaced.indexOf(CONQUEST_NAME) !== -1);