3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Add custom logger. Fix a bunch of errors. Optimize imports.

This commit is contained in:
Dragory 2020-07-22 22:56:21 +03:00
parent 0dae54745d
commit 1064a1ca46
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
89 changed files with 198 additions and 229 deletions

View file

@ -21,12 +21,12 @@ export const ContextCmd = utilityCmd({
return;
}
const previousMessage = (await this.bot.getMessages(args.channel.id, 1, args.messageId))[0];
const previousMessage = (await pluginData.client.getMessages(args.channel.id, 1, args.messageId))[0];
if (!previousMessage) {
sendErrorMessage(pluginData, msg.channel, "Message context not found");
return;
}
msg.channel.createMessage(messageLink(this.guildId, previousMessage.channel.id, previousMessage.id));
msg.channel.createMessage(messageLink(pluginData.guild.id, previousMessage.channel.id, previousMessage.id));
},
});

View file

@ -18,7 +18,7 @@ export const HelpCmd = utilityCmd({
const searchStr = args.command.toLowerCase();
const matchingCommands: Array<{
plugin: LoadedPlugin;
plugin: LoadedPlugin<any>;
command: PluginCommandDefinition;
}> = [];
@ -62,12 +62,10 @@ export const HelpCmd = utilityCmd({
.toLowerCase()
.replace(/\s/g, "-");
const pluginName = plugin.blueprint?.name || plugin.class?.pluginName;
let snippet = `**${prefix}${trigger}**`;
if (description) snippet += `\n${description}`;
if (usage) snippet += `\nBasic usage: \`${usage}\``;
snippet += `\n<https://zeppelin.gg/docs/plugins/${pluginName}/usage#command-${commandSlug}>`;
snippet += `\n<https://zeppelin.gg/docs/plugins/${plugin.blueprint.name}/usage#command-${commandSlug}>`;
return snippet;
});