system channel check
This commit is contained in:
parent
56d3d55b77
commit
616fc61b30
@ -15,7 +15,15 @@ module.exports = function(remote, events){
|
||||
console.log("Discord-message-out", event);
|
||||
}
|
||||
|
||||
const discord_channel_name = event.channel ? remote.channels[event.channel] : remote.channels[remote.system_channel];
|
||||
let discord_channel_name;
|
||||
|
||||
if (event.channel != null)
|
||||
// channel name sent, map to config channels
|
||||
discord_channel_name = remote.channels[event.channel];
|
||||
else
|
||||
// no channel sent, assuming system message
|
||||
discord_channel_name = remote.channels[remote.system_channel];
|
||||
|
||||
if (!discord_channel_name){
|
||||
console.warn("discord, not mapped channel found", event.channel);
|
||||
return;
|
||||
|
@ -63,7 +63,15 @@ module.exports = function(remote, events){
|
||||
console.log("irc-message-out", event);
|
||||
}
|
||||
|
||||
const channel = event.channel ? channels[event.channel] : channels[remote.system_channel];
|
||||
let channel;
|
||||
|
||||
if (event.channel != null)
|
||||
// channel name sent, map to config channels
|
||||
channel = channels[event.channel];
|
||||
else
|
||||
// no channel sent, assuming system message
|
||||
channel = channels[remote.system_channel];
|
||||
|
||||
if (channel) {
|
||||
if (event.username){
|
||||
channel.say(`<${event.username}${event.type == "minetest" ? "" : "@" + event.name}> ${event.message}`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user