Open djyumene opened 7 years ago
Let me see what I can do. I'll update you before the weekend is done.
Try commenting out line 115 and see if it works, like the below:
if (stanza.is('message') &&
//stanza.attrs.type === 'groupchat' &&
stanza.attrs.from !== ROOM_JID + '/' + IN_CHANNEL_BOT_NAME){
Let me know how it goes.
Just pushed up some fixes. Give it a try first.
Did this get sorted? I'm attempting to do roughly the same thing.
Not yet. I was hoping to get an answer back to see if it worked out.
Can you go to line 160 and change it from this:
if (stanza.is('message') && stanza.attrs.type === 'groupchat' && stanza.attrs.from !== ROOM_JID + '/' + IN_CHANNEL_BOT_NAME)
to this:
if (stanza.is('message') && stanza.attrs.from !== ROOM_JID + '/' + IN_CHANNEL_BOT_NAME)
and let me know if it works out? you can leave the chatroom field blank
I just connected it to the server. Entered a private message from another one of my accounts and got this error:
/home/relaybot/discord-xmpp/app.js:183 discord.channel.sendMessage(message); ^
TypeError: Cannot read property 'sendMessage' of undefined
at Client.
Sorry for the wait
Can you copy/paste this into line 182 and tell me what it spits out? "console.log(discord.channel);"
hey there, i'm trying to do the same thing and am running into the same wall.
I am able to successfully join a channel and relay info back and forth without any issue. but if I set it to get messages from our "pings" bot on the xmpp side... I don't get any action.
console.log(discord.channel); doesn't return anything.
What I am trying to do is this, relay between a PM in a xmpp client to discord.
Basically: I am trying to set this up for my alliance in Eve Online. We are part of a coalition that uses jabber to relay fleet broadcasts. We already have so many tools that we have to have open during the game, and we are trying to consolidate and make things more efficient; including getting those pings relayed into our alliance discord.
I was hoping that this would be able to do that, but it asks for the xmpp conference id, but there is none since the broadcasts are given in a private message window from the ping bot.
So this is what I have, and it obviously doesn't work:
const DISCORD_API_TOKEN = 'myapitoken'; const DISCORD_CHATROOM_ID = 'myroomid'; const JID = 'myusername@fcon.us'; const PASSWORD = 'mypassword'; const ROOM_JID = 'botusername@fcon.us'; const HOST = 'fcon.us'; const PORT = 5222;