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");
//todo figure out new way to buffer
function dSend(msg, options) {
if (arguments.length == 1) options = msg;
function dSend(msg, options = {}) {
if (msg) options.content = msg;
if (options.content?.length > 2000) {
options.attachments ||= [];
@ -150,7 +150,7 @@ global.createMPPbridge = async function createMPPbridge({room, channel, uri}) {
// on notifications
gClient.on('notification', async msg => {
// show notification
dSend({embeds:[{
dSend(undefined, {embeds:[{
title: msg.title,
description: msg.text || msg.html
}]});