forked from Galactic/modmail
bugfix to listing canned responses
This commit is contained in:
parent
c09dba2f41
commit
c63f41beed
@ -117,8 +117,8 @@ class ModmailClient extends Client {
|
||||
|
||||
this.logger.debug(`${message.author.tag} is executing command ${command.name}`);
|
||||
const clean = message.content.replace(`${this.prefix}${commandName}`, '').trim();
|
||||
const result = await command.execute(message, { args, clean }).catch((err) => {
|
||||
this.logger.error(`Command ${command.name} errored during execution:\nARGS: [${args.join(', ')}]\n${err.stack}`);
|
||||
const result = await command.execute(message, { args: [ ...args ], clean }).catch((err) => {
|
||||
this.logger.error(`Command ${command.name} errored during execution:\nARGS: [ "${args.join('", "')}" ]\n${err.stack}`);
|
||||
return {
|
||||
error: true,
|
||||
msg: `Command ${command.name} ran into an error during execution. This has been logged.`
|
||||
|
@ -30,13 +30,14 @@ class CannedReply extends Command {
|
||||
let str = '';
|
||||
// eslint-disable-next-line no-shadow
|
||||
for (const [ name, content ] of list) {
|
||||
if (str.length + content.length > 2000) {
|
||||
await channel.send(str); // .catch(err => this.client.logger.error(`CannedReply.execute errored at channel.send:\n${err.stack}`));
|
||||
const substr = `**${name}:** ${content}\n`;
|
||||
if (str.length + substr.length > 2000) {
|
||||
await channel.send(str);
|
||||
str = '';
|
||||
}
|
||||
str += `**${name}:** ${content}\n`;
|
||||
str += substr;
|
||||
}
|
||||
if (str.length) return channel.send(str); // .catch(err => this.client.logger.error(`CannedReply.execute errored at channel.send:\n${err.stack}`));
|
||||
if (str.length) return channel.send(str);
|
||||
return '**__None__**';
|
||||
}
|
||||
return this.client.modmail.sendCannedResponse({ message, responseName: content.trim(), anon });
|
||||
|
Loading…
Reference in New Issue
Block a user