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");
|
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 ||= [];
|
||||||
options.attachments.push(new Discord.MessageAttachment(Buffer.from(options.content), "message.txt"));
|
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
|
// 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
|
||||||
}]});
|
}]});
|
||||||
|
|
Loading…
Reference in New Issue