Fix snippet took as language identifier (#491)

Added a new line so it doesn't take snippet as language identifier.
Without this new line, if the first line of the snippet contains only one word (if it doesn't have at least 1 space character), the first line is taken as a language identifier, unknown in most cases.
Just added `\n` to avoid using snippet as a language identifier.
cshd
Gugu72 2020-11-01 19:38:58 +01:00 committed by GitHub
parent 9f8c94939d
commit 8e69385389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ module.exports = ({ bot, knex, config, commands }) => {
utils.postSystemMessageWithFallback(msg.channel, thread, `Snippet "${args.trigger}" already exists! You can edit or delete it with ${config.prefix}edit_snippet and ${config.prefix}delete_snippet respectively.`); utils.postSystemMessageWithFallback(msg.channel, thread, `Snippet "${args.trigger}" already exists! You can edit or delete it with ${config.prefix}edit_snippet and ${config.prefix}delete_snippet respectively.`);
} else { } else {
// If the snippet exists and we're NOT trying to create a new one, show info about the existing snippet // If the snippet exists and we're NOT trying to create a new one, show info about the existing snippet
utils.postSystemMessageWithFallback(msg.channel, thread, `\`${config.snippetPrefix}${args.trigger}\` replies with: \`\`\`${utils.disableCodeBlocks(snippet.body)}\`\`\``); utils.postSystemMessageWithFallback(msg.channel, thread, `\`${config.snippetPrefix}${args.trigger}\` replies with: \`\`\`\n${utils.disableCodeBlocks(snippet.body)}\`\`\``);
} }
} else { } else {
if (args.text) { if (args.text) {