Skip to content

Commit d7ff850

Browse files
committed
Merge branch 'dev'
2 parents b78ea52 + 3b811f2 commit d7ff850

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/commands/delete.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ export default new Command('delete', async (caller, cmd, log) => {
1212
if (!message || message.type !== 'STAFF_REPLY')
1313
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be found.');
1414

15-
caller.db.editMessage(log!, message.id, '[DELETED] ' + message.content);
16-
1715
const userMsg = await caller.utils.discord.fetchMessage(log!.recipient.id, message.complementaryID!, true);
1816
if (!userMsg || !userMsg.embeds[0])
1917
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be found.');
2018

2119
// Delete the user message.
2220
userMsg.delete()
2321
.catch(() => {
24-
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be deleted.');
22+
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be deleted for the user.');
2523
});
2624

25+
caller.db.editMessage(log!, message.id, '[DELETED] ' + message.content);
26+
2727
guildMsg.embeds[0].description = '[DELETED] ' + guildMsg.embeds[0].description;
2828
guildMsg.embeds[0].footer ? guildMsg.embeds[0].footer.text = 'Deleted' : guildMsg.embeds[0].footer = { text: 'Deleted' };
2929
guildMsg.edit({ embed: guildMsg.embeds[0] })
3030
.catch(() => {
31-
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be deleted.');
31+
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be deleted in this channel.');
3232
});
3333
caller.utils.discord.createMessage(cmd.channel.id, 'The message has been deleted.');
3434
},

src/commands/edit.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export default new Command('edit', async (caller, cmd, log) => {
1414
if (!message || message.type !== 'STAFF_REPLY')
1515
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be found.');
1616

17-
caller.db.editMessage(log!, message.id, cmd.args.slice(1).join(' '));
18-
1917
const userMsg = await caller.utils.discord.fetchMessage(log!.recipient.id, message.complementaryID!, true);
2018
if (!userMsg || !userMsg.embeds[0])
2119
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be found.');
@@ -24,14 +22,16 @@ export default new Command('edit', async (caller, cmd, log) => {
2422
userMsg.embeds[0].description = cmd.args.slice(1).join(' ');
2523
userMsg.edit({ embed: userMsg.embeds[0] })
2624
.catch(() => {
27-
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be edited.');
25+
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be edited for the user.');
2826
});
2927

28+
caller.db.editMessage(log!, message.id, cmd.args.slice(1).join(' '));
29+
3030
guildMsg.embeds[0].description = cmd.args.slice(1).join(' ');
3131
guildMsg.embeds[0].footer ? guildMsg.embeds[0].footer.text = 'Edited' : guildMsg.embeds[0].footer = { text: 'Edited' };
3232
guildMsg.edit({ embed: guildMsg.embeds[0] })
3333
.catch(() => {
34-
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be edited.');
34+
return caller.utils.discord.createMessage(cmd.channel.id, 'The message could not be edited in this channel.');
3535
});
3636
caller.utils.discord.createMessage(cmd.channel.id, 'The message has been edited.');
3737
},

0 commit comments

Comments
 (0)