This commit is contained in:
Lamp 2022-01-03 21:06:31 -08:00
parent 1b01804230
commit 849ae63144
1 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,8 @@ global.createMPPbridge = async function createMPPbridge({room, channel, uri}) {
var webhook = webhooks.filter(w => w.token).first() || await channel.createWebhook("sdfadffg"); var webhook = webhooks.filter(w => w.token).first() || await channel.createWebhook("sdfadffg");
//todo figure out new way to buffer //todo figure out new way to buffer
function dSend(msg, options) { function dSend(msg, options = {}) {
if (arguments.length == 1) options = msg; if (msg) options.content = msg;
if (options.content?.length > 2000) { if (options.content?.length > 2000) {
options.attachments ||= []; options.attachments ||= [];
@ -150,7 +150,7 @@ global.createMPPbridge = async function createMPPbridge({room, channel, uri}) {
// on notifications // on notifications
gClient.on('notification', async msg => { gClient.on('notification', async msg => {
// show notification // show notification
dSend({embeds:[{ dSend(undefined, {embeds:[{
title: msg.title, title: msg.title,
description: msg.text || msg.html description: msg.text || msg.html
}]}); }]});