Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const availableFontsAllowedValuesString = `Enter the number of the font you want from below.\n\n${fontDescriptionList}\n\nNote that some fonts support more kanji than others. You may see me fall back to a different font for kanji that isn't supported by your chosen font.`;
module.exports = [
{
userFacingName: 'Quiz',
children:
[
{
userFacingName: 'Answer time limit',
description: 'This setting controls how many seconds players have to answer a quiz question before I say time\'s up and move on to the next question.',
allowedValuesDescription: 'A number between 5 and 120 (in seconds)',
uniqueId: 'quiz/japanese/answer_time_limit',
defaultUserFacingValue: '16',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(5, 120),
},
{
userFacingName: 'Score limit',
description: 'This setting controls how many points the quiz game stops at. When a player scores this many points, the game stops and they win.',
allowedValuesDescription: 'A whole number between 1 and 10000',
uniqueId: 'quiz/japanese/score_limit',
defaultUserFacingValue: '10',
convertUserFacingValueToInternalValue: SettingsConverters.stringToInt,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(1, 10000),
},
{
userFacingName: 'Unanswered question limit',
description: 'This setting controls how many questions in a row are allowed to go unanswered before the game stops. The intended purpose for this is to automatically end games that players abandon.',
allowedValuesDescription: 'A whole number between 1 and 25',
const availableFontsAllowedValuesString = `Enter the number of the font you want from below.\n\n${fontDescriptionList}\n\nNote that some fonts support more kanji than others. You may see me fall back to a different font for kanji that isn't supported by your chosen font.`;
module.exports = [
{
userFacingName: 'Quiz',
children:
[
{
userFacingName: 'Answer time limit',
description: 'This setting controls how many seconds players have to answer a quiz question before I say time\'s up and move on to the next question.',
allowedValuesDescription: 'A number between 5 and 120 (in seconds)',
uniqueId: 'quiz/japanese/answer_time_limit',
defaultUserFacingValue: '16',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(5, 120),
},
{
userFacingName: 'Score limit',
description: 'This setting controls how many points the quiz game stops at. When a player scores this many points, the game stops and they win.',
allowedValuesDescription: 'A whole number between 1 and 10000',
uniqueId: 'quiz/japanese/score_limit',
defaultUserFacingValue: '10',
convertUserFacingValueToInternalValue: SettingsConverters.stringToInt,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(1, 10000),
},
{
userFacingName: 'Unanswered question limit',
description: 'This setting controls how many questions in a row are allowed to go unanswered before the game stops. The intended purpose for this is to automatically end games that players abandon.',
allowedValuesDescription: 'A whole number between 1 and 25',
description: 'This setting controls the background 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_background_color',
defaultUserFacingValue: 'rgb(255, 255, 255)',
convertUserFacingValueToInternalValue: SettingsConverters.toString,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Quiz text font size',
description: 'This setting controls the font size of the text rendered for quizzes.',
allowedValuesDescription: 'A number between 20 and 200 (in font size points)',
uniqueId: 'quiz_font_size',
defaultUserFacingValue: '106',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(20, 200),
},
{
userFacingName: 'Quiz font',
description: 'This setting controls the font used for text rendered for quizzes.',
allowedValuesDescription: availableFontsAllowedValuesString,
uniqueId: 'quiz_font',
defaultUserFacingValue: 'Yu Mincho',
convertUserFacingValueToInternalValue: SettingsConverters.createMapConverter(
fontForInput,
true,
),
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.isMappable,
},
{
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,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Quiz text background color',
description: 'This setting controls the background 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_background_color',
defaultUserFacingValue: 'rgb(255, 255, 255)',
convertUserFacingValueToInternalValue: SettingsConverters.toString,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Quiz text font size',
description: 'This setting controls the font size of the text rendered for quizzes.',
description: 'This setting controls the color of the text produced by the furigana command.',
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: 'furigana_font_color',
defaultUserFacingValue: 'rgb(192, 193, 194)',
convertUserFacingValueToInternalValue: SettingsConverters.toString,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Furigana background color',
description: 'This setting controls the background color of the text produced by the furigana command.',
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: 'furigana_background_color',
defaultUserFacingValue: 'rgb(54, 57, 62)',
convertUserFacingValueToInternalValue: SettingsConverters.toString,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Furigana font size',
description: 'This setting controls the font size of the main text of the furigana command. The size of the furigana text (above the main text) is this value divided by two.',
allowedValuesDescription: 'A number between 10 and 80 (in font size points)',
uniqueId: 'furigana_main_font_size',
defaultUserFacingValue: '40',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(20, 80),
},
{
userFacingName: 'Furigana font',
description: 'This setting controls the font used for the furigana command.',
allowedValuesDescription: availableFontsAllowedValuesString,
allowedValuesDescription: 'A whole number between 1 and 10000',
uniqueId: 'quiz/japanese/score_limit',
defaultUserFacingValue: '10',
convertUserFacingValueToInternalValue: SettingsConverters.stringToInt,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(1, 10000),
},
{
userFacingName: 'Unanswered question limit',
description: 'This setting controls how many questions in a row are allowed to go unanswered before the game stops. The intended purpose for this is to automatically end games that players abandon.',
allowedValuesDescription: 'A whole number between 1 and 25',
uniqueId: 'quiz/japanese/unanswered_question_limit',
userSetting: false,
defaultUserFacingValue: '5',
convertUserFacingValueToInternalValue: SettingsConverters.stringToInt,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(1, 25),
},
{
userFacingName: 'Delay after unanswered question',
description: 'This setting controls how long I will wait (in seconds) after a timed out question before showing a new one. By setting this higher, players get more time to view and consider the correct answer.',
allowedValuesDescription: 'A number between 0 and 120',
uniqueId: 'quiz/japanese/new_question_delay_after_unanswered',
defaultUserFacingValue: '3.25',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(0, 120),
},
{
userFacingName: 'Delay after answered question',
description: 'This setting controls how long I will wait (in seconds) after an answer is correctly answered and the window for additional answers closes, before I show a new question. For example, if **Additional answer wait window** is set to two, and this setting is set to three, then after a question is answered correctly a total of five seconds will pass before I ask a new one.',
allowedValuesDescription: 'A number between 0 and 120',
uniqueId: 'shiritori/bot_turn_maximum_wait',
serverOnly: false,
defaultUserFacingValue: '4.75',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(1, 30),
},
{
userFacingName: 'Answer time limit',
description: 'This setting controls the amount of time (in seconds) that players have to give their answer. This does not apply to the bot player.',
allowedValuesDescription: 'A number between 5 and 300',
uniqueId: 'shiritori/answer_time_limit',
serverOnly: false,
defaultUserFacingValue: '40',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(5, 300),
},
],
},
{
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',
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,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Quiz text background color',
description: 'This setting controls the background 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_background_color',
defaultUserFacingValue: 'rgb(255, 255, 255)',
convertUserFacingValueToInternalValue: SettingsConverters.toString,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: validateRGBorRGBA,
},
{
userFacingName: 'Quiz text font size',
description: 'This setting controls the font size of the text rendered for quizzes.',
allowedValuesDescription: 'A number between 20 and 200 (in font size points)',
uniqueId: 'quiz_font_size',
defaultUserFacingValue: '100',
convertUserFacingValueToInternalValue: SettingsConverters.stringToFloat,
convertInternalValueToUserFacingValue: SettingsConverters.toString,
validateInternalValue: SettingsValidators.createRangeValidator(20, 200),
},
{
userFacingName: 'Furigana font',
description: 'This setting controls the font used for the furigana command.',