fix 3
This commit is contained in:
parent
1b01804230
commit
849ae63144
|
@ -6,9 +6,9 @@ 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 ||= [];
|
||||
options.attachments.push(new Discord.MessageAttachment(Buffer.from(options.content), "message.txt"));
|
||||
|
@ -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
|
||||
}]});
|
||||
|
|
Loading…
Reference in New Issue