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

feat: add editing support to InternalPoster

This commit is contained in:
Dragory 2021-11-02 23:10:37 +02:00
parent ecd9a5863c
commit 31f18ba27f
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
6 changed files with 113 additions and 39 deletions

View file

@ -56,8 +56,12 @@ export async function postCaseToCaseLogChannel(
const [channelId, messageId] = theCase.log_message_id.split("-");
try {
const poster = pluginData.getPlugin(InternalPosterPlugin);
const channel = pluginData.guild.channels.resolve(channelId as Snowflake) as TextChannel;
await channel.messages.edit(messageId as Snowflake, caseEmbed);
const message = await channel.messages.fetch(messageId);
if (message) {
await poster.editMessage(message, caseEmbed);
}
return;
} catch {} // tslint:disable-line:no-empty
}