mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
logs: add support for embeds in log formats
This commit is contained in:
parent
b6b4154b2d
commit
8b22ce267d
3 changed files with 75 additions and 54 deletions
|
@ -59,7 +59,14 @@ export async function log(pluginData: PluginData<LogsPluginType>, type: LogType,
|
|||
|
||||
const message = await getLogMessage(pluginData, type, data);
|
||||
if (message) {
|
||||
const batched = opts.batched ?? true; // Default to batched unless explicitly disabled
|
||||
// For non-string log messages (i.e. embeds) batching or chunking is not possible, so send them immediately
|
||||
if (typeof message !== "string") {
|
||||
await channel.createMessage(message).catch(noop);
|
||||
return;
|
||||
}
|
||||
|
||||
// Default to batched unless explicitly disabled
|
||||
const batched = opts.batched ?? true;
|
||||
const batchTime = opts.batch_time ?? 1000;
|
||||
|
||||
if (batched) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue