How to use the monochrome-bot.SettingsConverters.createBooleanToStringConverter 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 / bot / src / bot_settings.js View on Github external
],
  },
  {
    userFacingName: 'Shiritori Forever',
    children:
    [
      {
        userFacingName: 'Shiritori Forever enabled',
        description: 'Control whether Shiritori Forever is enabled, and where. After you change the setting, you will be asked where to apply it.',
        allowedValuesDescription: 'Either **enabled** or **disabled**',
        uniqueId: 'shiritoriforever',
        userSetting: false,
        serverSetting: false,
        defaultUserFacingValue: 'Disabled',
        convertUserFacingValueToInternalValue: SettingsConverters.createStringToBooleanConverter('enabled', 'disabled'),
        convertInternalValueToUserFacingValue: SettingsConverters.createBooleanToStringConverter('Enabled', 'Disabled'),
        validateInternalValue: SettingsValidators.isBoolean,
        onChannelSettingChanged: onShiritoriForeverEnabledChanged,
      },
    ],
  },
];
github mistval / kotoba / src / bot_settings.js View on Github external
uniqueId: 'quiz/japanese/conquest_and_inferno_enabled',
        userSetting: false,
        defaultUserFacingValue: 'Enabled',
        convertUserFacingValueToInternalValue: SettingsConverters.createStringToBooleanConverter('enabled', 'disabled'),
        convertInternalValueToUserFacingValue: SettingsConverters.createBooleanToStringConverter('Enabled', 'Disabled'),
        validateInternalValue: SettingsValidators.isBoolean,
      },
      {
        userFacingName: 'Internet decks enabled',
        description: 'This setting controls whether decks imported from the internet may be used in this channel. If enabled, it is possible that someone will load a deck containing disagreeable content in this channel.',
        allowedValuesDescription: 'Either **enabled** or **disabled**',
        uniqueId: 'quiz/japanese/internet_decks_enabled',
        userSetting: false,
        defaultUserFacingValue: 'Disabled',
        convertUserFacingValueToInternalValue: SettingsConverters.createStringToBooleanConverter('enabled', 'disabled'),
        convertInternalValueToUserFacingValue: SettingsConverters.createBooleanToStringConverter('Enabled', 'Disabled'),
        validateInternalValue: SettingsValidators.isBoolean,
      },
    ],
  },
  {
    userFacingName: 'Fonts',
    children:
    [
      {
        userFacingName: 'Quiz text font color',
        description: 'This setting controls the color of the text rendered for quizzes.',
        allowedValuesDescription: 'Figure out the red, blue, and green components of the color you want and enter a value like this: **rgb(100, 50, 10)** (that\'s red 100, green 50, and blue 10). You can use [a tool like this](https://www.w3schools.com/colors/colors_rgb.asp) to get the color you want. Play around with the sliders, and then copy the **rgb(x,y,z)** value that it shows you. Each color component must be a whole number between 0 and 255. (rgba works too)',
        uniqueId: 'quiz_font_color',
        defaultUserFacingValue: 'rgb(0, 0, 0)',
        convertUserFacingValueToInternalValue: SettingsConverters.toString,
        convertInternalValueToUserFacingValue: SettingsConverters.toString,