diff --git a/commands/message/core/help.js b/commands/message/core/help.js index 2759a5f..4e7ef1c 100644 --- a/commands/message/core/help.js +++ b/commands/message/core/help.js @@ -1,7 +1,7 @@ const { codeblock, highlight, icon, link, pill, smallPill } = require('../../../labscore/utils/markdown') const { createEmbed, formatPaginationEmbeds } = require('../../../labscore/utils/embed') -const { DISCORD_INVITES } = require('../../../labscore/constants') +const { DISCORD_INVITES, DEFAULT_BOT_PREFIX } = require('../../../labscore/constants') const { paginator } = require('../../../labscore/client'); const { editOrReply } = require('../../../labscore/utils/message'); @@ -12,7 +12,7 @@ function createHelpPage(context, title, contents, descriptions){ createEmbed("default", context, { description: `${title}\n\n` + renderCommandList(contents, descriptions) + - `\n\n${icon("question")} Use ${pill(`${context.commandClient.prefixes.custom.first()}help `)} to view more information about a command.` + `\n\n${icon("question")} Use ${pill(`${DEFAULT_BOT_PREFIX}help `)} to view more information about a command.` }) ] } @@ -120,7 +120,7 @@ module.exports = { } let pages = [] - let prefix = context.commandClient.prefixes.custom.first() + let prefix = DEFAULT_BOT_PREFIX try{ if(results.length == 0) return editOrReply(context, {embeds: [createEmbed("warning", context, "No commands found for the provided query.")]}) @@ -158,7 +158,6 @@ module.exports = { let commands = {} let descriptions = {} - let prefix = context.commandClient.prefixes.custom.first() for(const c of context.commandClient.commands){ if(!categories[c.metadata.category]) continue; if(c.metadata.explicit && !context.channel.nsfw) continue; diff --git a/commands/message/fun/art.js b/commands/message/fun/art.js index 9398f6a..c925ffb 100644 --- a/commands/message/fun/art.js +++ b/commands/message/fun/art.js @@ -3,6 +3,7 @@ const { editOrReply } = require('../../../labscore/utils/message') const superagent = require('superagent'); const { codeblock } = require('../../../labscore/utils/markdown'); +const { DEFAULT_BOT_PREFIX } = require('../../../labscore/constants'); const SIZES = Object.freeze({ "wallpaper": { x: 1120, y: 630}, @@ -80,11 +81,11 @@ module.exports = { }) res = JSON.parse(res.text) - + await response.edit({ embeds: [ createEmbed("default", context, { - description: `${codeblock(`py`, [`${context.commandClient.prefixes.custom.first()}art -type ${args.type.toLowerCase()} -seed ${seed} -variance ${variance} -rotate ${rotate}`])}`, + description: `${codeblock(`py`, [`${DEFAULT_BOT_PREFIX}art -type ${args.type.toLowerCase()} -seed ${seed} -variance ${variance} -rotate ${rotate}`])}`, image: { url: res.image_link }, diff --git a/labscore/client.js b/labscore/client.js index 2102cee..57f3aff 100644 --- a/labscore/client.js +++ b/labscore/client.js @@ -33,12 +33,13 @@ module.exports.paginator = new Paginator(cluster, { // Clients -let commandPrefixes = ['lc..', 'ic.', 'lc.'] // Migration from beta -> main, remove lc.. eventually +let commandPrefixes = ['lc.', 'ic.', 'lc..'] // Migration from beta -> main, remove lc.. eventually if(process.env.PREFIX_OVERRIDE) commandPrefixes = process.env.PREFIX_OVERRIDE.split('|'); const commandClient = new CommandClient(cluster, { activateOnEdits: true, mentionsEnabled: false, + prefix: commandPrefixes[0], prefixes: commandPrefixes, useClusterClient: true, ratelimits: [ @@ -57,7 +58,8 @@ const { editOrReply } = require('./utils/message'); // Delete command responses if the user chooses to delete their trigger or edits the command away commandClient.on('commandDelete', async ({context, reply}) => { - if(context.message?.deleted && !reply.deleted || !context.message.content.startsWith(commandPrefix)) reply.delete(); + for(const p of commandPrefixes) if(context.message.content.startsWith(p)) return; + if(context.message?.deleted && !reply.deleted) reply.delete(); }) commandClient.on('commandRunError', async ({context, error}) => { diff --git a/labscore/constants.js b/labscore/constants.js index 3b112fa..8601c57 100644 --- a/labscore/constants.js +++ b/labscore/constants.js @@ -3,6 +3,8 @@ module.exports.DISCORD_INVITES = Object.freeze({ privacy: "https://discord.gg/sQs8FhcTGh" }) +module.exports.DEFAULT_BOT_PREFIX = 'lc.' + module.exports.PRIVACY_POLICY_SECTIONS = [ 'labsCore does not collect any sort of data about its users.', 'If the bot encounters unexpected errors we report information about the server, channel, user and command/command arguments (excluding images) to a private log in order to assist with debugging and resolving the issue. You can reference the provided error ID in our support server for further details. Contents of these automated reports will never be shared with third parties and are only accessible to the bots developers.', @@ -629,4 +631,38 @@ module.exports.GOOGLE_CLOUD_SAFETY_LABELS = Object.freeze({ icon: "exclaim_4", name: "Very Likely " } +}) + +module.exports.MAPKIT_ACTIONS = Object.freeze({ + SEARCH: "search", + STATIC_MAP: "render" +}) + +module.exports.REXTESTER_LANGUAGES = Object.freeze({ + "bash": "38", + "node": "23", + "js": "23", + "py": "5", + "java": "4", + "lua": "14", + "ruby": "12", + "perl": "13", + "go": "20", + //"kt": "43", + "rust": "46", + "php": "8", + "c": "6", + "cpp": "7", + 'cs': "1", + "elixir": "41", + "swift": "37", + "bf": "44", + "scala": "21", + "haskell": "11" +}) + +module.exports.REXTESTER_COMPILER_ARGS = Object.freeze({ + "6": "-Wall -std=gnu99 -O2 -o a.out source_file.c", + "7": "-Wall -std=c++14 -O2 -o a.out source_file.cpp", + "11": "-o a.out source_file.hs" }) \ No newline at end of file