announce connection on discord

This commit is contained in:
BuckarooBanzay 2020-05-26 08:24:25 +02:00
parent 2c659b5318
commit 1681fccf84

View File

@ -16,6 +16,15 @@ module.exports = function(remote, events){
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
// Send connection announcement
Object.keys(remote.channels).forEach(ingame_name => {
const discord_channel_name = remote.channels[ingame_name];
const channel = client.channels.cache.find(ch => ch.name === discord_channel_name);
if (channel) {
channel.send(`beerchat_proxy connected! ingame-channel: ${ingame_name}`);
}
});
events.on("message-out", function(event){
if (event.name == remote.name)
// not meant for this remote, ignore