discord command support :3

This commit is contained in:
Parker2991
2024-08-04 22:59:52 -04:00
parent 47ff57eeb6
commit 7c85c53eb1
38 changed files with 8140 additions and 6960 deletions
+19 -6
View File
@@ -20,12 +20,6 @@ function command_manager (bot, options, config, discordClient) {
}
} else if (!source?.sources?.discord && !source?.sources?.console) {
if (!command || !command.execute)
/* throw new CommandError({
translate: "Unknown command: %s",
with: [
commandName
]
})*/
throw new CommandError(
bot.getMessageAsPrismarine([
{
@@ -41,6 +35,25 @@ function command_manager (bot, options, config, discordClient) {
translate: "command.context.here"
}])?.toMotd(bot.registry.language)
)
} else if (source?.sources?.console && !source?.sources?.discord) {
if (!command || !command.execute)
bot.console.warn(bot.getMessageAsPrismarine([
{
translate: 'command.unknown.command',
color: "dark_red"
},
{
text: "\n",
},
{
text: `${commandName}`,
color: "dark_red"
},
{
translate: "command.context.here",
color: "dark_red"
}
])?.toAnsi())
}
if (command?.trustLevel > 0) {
const event = bot?.discord?.message;