3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix error if the bot attempts to save a message that was already saved

This commit is contained in:
Miikka Virtanen 2019-08-14 10:57:39 +03:00
parent a48a58bd3c
commit 1e549ef2a3

View file

@ -147,6 +147,9 @@ export class GuildSavedMessages extends BaseGuildRepository {
}
async createFromMsg(msg: Message, overrides = {}) {
const existingSavedMsg = await this.find(msg.id);
if (existingSavedMsg) return;
const savedMessageData = this.msgToSavedMessageData(msg);
const postedAt = moment.utc(msg.timestamp, "x").format("YYYY-MM-DD HH:mm:ss.SSS");