3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00

Show message source/data in !source

This commit is contained in:
Dragory 2019-04-30 05:35:38 +03:00
parent 70591eec3b
commit 6b0345d1f0

View file

@ -711,12 +711,10 @@ export class UtilityPlugin extends ZeppelinPlugin<IUtilityPluginConfig> {
return; return;
} }
if (!savedMessage.data.content) { const source =
msg.channel.createMessage(errorMessage("Message content is empty")); (savedMessage.data.content || "<no text content>") + "\n\nSource:\n\n" + JSON.stringify(savedMessage.data);
return;
}
const archiveId = await this.archives.create(savedMessage.data.content, moment().add(1, "hour")); const archiveId = await this.archives.create(source, moment().add(1, "hour"));
const url = this.archives.getUrl(this.knub.getGlobalConfig().url, archiveId); const url = this.archives.getUrl(this.knub.getGlobalConfig().url, archiveId);
msg.channel.createMessage(`Message source: ${url}`); msg.channel.createMessage(`Message source: ${url}`);
} }