logs: add timestamps to embeds, add setting to turn off embed timestamps, move timestamp format setting to root/channel level

This commit is contained in:
Dragory 2020-10-11 02:32:55 +03:00
parent b158817bff
commit 400f1f0807
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
4 changed files with 42 additions and 16 deletions

View file

@ -62,7 +62,12 @@ export async function log(pluginData: GuildPluginData<LogsPluginType>, type: Log
}
}
const message = await getLogMessage(pluginData, type, data, opts.format);
const message = await getLogMessage(pluginData, type, data, {
format: opts.format,
include_embed_timestamp: opts.include_embed_timestamp,
timestamp_format: opts.timestamp_format,
});
if (message) {
// For non-string log messages (i.e. embeds) batching or chunking is not possible, so send them immediately
if (typeof message !== "string") {