alejzeis / groupme-discord-bridge

A bridge bot which connects a GroupMe chat and a Discord Guild
BSD 2-Clause "Simplified" License
9 stars 10 forks source link

General Setup Errors #1

Open Nedihardt97 opened 6 years ago

Nedihardt97 commented 6 years ago

upon launching the app, the following is output: image the line in question contains the following: const Discord = require("discord.js"); commenting this line out causes the same error to appear in the next line, and the next, and so on until all the dependency checkers are commented out and the system begins outputting errors in the middle of elements at anywhere a colon (:) is Attempting to run via a node.js administrator cmd prompt version 8.11.0 All dependencies are installed

alejzeis commented 6 years ago

Are you launching correctly? You should run "node app.js" and it should run.

On Thu, Jul 12, 2018, 22:04 Nedihardt97 notifications@github.com wrote:

upon launching the app, the following is output: [image: image] https://user-images.githubusercontent.com/25507769/42670217-84f5dfcc-8627-11e8-846e-d3ed335bd147.png the line in question contains the following: const Discord = require("discord.js"); commenting this line out causes the same error to appear in the next line, and the next, and so on until all the dependency checkers are commented out and the system begins outputting errors in the middle of elements at anywhere a colon (:) is Attempting to run via a node.js administrator cmd prompt version 8.11.0 All dependencies are installed

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jython234/groupme-discord-bridge/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AFtT5n1heZzDhaSP14UiHDgw7MHcGB0pks5uGA5YgaJpZM4VOOj- .

Nedihardt97 commented 6 years ago

ok, running it like that appears to allow the system to create the config file (loading values from app.js) and launch. However, it gets stuck at the output of:

Express now listening for requests Discord Client Ready.

sending a message to discord or groupme fails to relay. something to note is that I have not filled out the callbackURLPrefix: field I suspect that is needed, however, I cannot discern what it needs to be nor can I find any clear answer to what it might need to be.

alejzeis commented 6 years ago

Yeah, sorry for lack of documentation. First make sure you have created a discord bot and invited it to your server (see this handy page). You'll need to get the token too and put that in bridgeBot.yml, in the token field.

The username field in bridgeBot.yml should be the same username that you gave the discord bot you created.

Next you need to create a groupme bot, (go here, and click on "create bot" (once you've signed into your groupme account)). The "callback URL" field is the most important, as that needs to be the URL of whatever device you'll be running the bridge on so GroupMe can send messages to the bridge.

The bridge will always listen at localhost/callback, so let's say i'm running the bridge at example.com on port 8088, the callback URL that I would give to groupMe would be example.com:8088/callback. However, maybe I'm running a webserver at that address, and/or I want to change the URL. That's where I would change callbackURLPrefix in bridgeBot.yml to something like /_groupme, so my callback URL would then become example.com:8088/_groupme/callback. You can leave it blank if you want, I added that feature because I'm running mine behind a reverse proxy setup.

So, once you've created the GroupMe bot, you'll need to copy the botId and put it in bridgeBot.ymlunder the botId field. You'll also need accessToken which you can get by clicking on the button accessToken on the GroupMe developers page on the top right.

Finally you'll need the discord Guild ID and Channel ID that you want to bridge. Make sure you have developer mode on in Discord (Should be under Settings, in "appearance"). Then right click on the Server that the channel belongs to, and click "copy ID". Your clipboard now has the ID which you can put in bridgeBot.yml under "guild". Repeat the same step to get the channel ID, except right clicking on the channel you want to bridge.

And that should be it!

It is a bit complicated, and it's designed to run on a server not a home computer as GroupMe has to be able to connect to the bridge to send it messages. There's no way around that. If you want to run it at home you'll need to port forward and such.

Also it can only bridge one channel to one group, which is quite a limitation.

Let me know if there's further issues, I'll be happy to help.

Nedihardt97 commented 6 years ago

Right, I think the main issue is the groupme side callback URL since I'm directly hosting the bridge on my desktop. In which case, would it be MY.PC.IP.ADDRESS:PORT? And if so, how should I go about determining the port?

Nedihardt97 commented 6 years ago

ok, so I gave it http://MY.PC.IP.ADDRESS:PORT on the groupme side and the API took it, but it's still not relaying the messages I think it may be my port though

alejzeis commented 6 years ago

The port will be the value of listenPort in the config file. Make sure you've port forwarded, and if your computer has a firewall, opened the port on the firewall. The IP address will be your external IP address, not your internal.

Nedihardt97 commented 6 years ago

well, I added in the port forwarding in my config, but still no change internal IP is set to the same IP as the the desktop I'm hosting on as well

alejzeis commented 6 years ago

Could you post your config? (You can redact the tokens and such)

On Fri, Jul 13, 2018, 14:58 Nedihardt97 notifications@github.com wrote:

well, I added in the port forwarding in my config, but still no change

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jython234/groupme-discord-bridge/issues/1#issuecomment-404937938, or mute the thread https://github.com/notifications/unsubscribe-auth/AFtT5mmjpsHy82XD65o7UuBG7swgEd9pks5uGPvbgaJpZM4VOOj- .

Nedihardt97 commented 6 years ago

I've set the firewall rule, added the service in the router config, entered the port into the app config, and entered the IP:Port into the groupme callback URL, and it still won't work

alejzeis commented 6 years ago

Does discord to GroupMe work? That should work as it's independent of callback and such.

On Fri, Jul 13, 2018, 22:08 Nedihardt97 notifications@github.com wrote:

I've set the firewall rule, added the service in the router config, entered the port into the app config, and entered the IP:Port into the groupme callback URL, and it still won't work

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jython234/groupme-discord-bridge/issues/1#issuecomment-404994437, or mute the thread https://github.com/notifications/unsubscribe-auth/AFtT5kvuBNCTARRsKaFXJFDwwcwBMwzrks5uGWCngaJpZM4VOOj- .

Nedihardt97 commented 6 years ago

Negative, doesn't relay either direction

alejzeis commented 6 years ago

Does the bot show up online in the server? Are you sure the channel and guild IDs are correct?

On Mon, Jul 16, 2018, 01:27 Nedihardt97 notifications@github.com wrote:

Negative, doesn't relay either direction

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jython234/groupme-discord-bridge/issues/1#issuecomment-405158287, or mute the thread https://github.com/notifications/unsubscribe-auth/AFtT5rRsUdVzCdds2JGQCjC1j2pLbi2hks5uHDJOgaJpZM4VOOj- .

Nedihardt97 commented 6 years ago

Yes, it showed up as online on the discord server, double checked the IDs. Program simply didn't do anything.

alejzeis commented 6 years ago

Alright, I'll see if it still works for me or not, I'm probably going to end up rewriting it anyway to be more clean and documented.

On Tue, Jul 17, 2018, 09:58 Nedihardt97 notifications@github.com wrote:

Yes, it showed up as online on the discord server, double checked the IDs. Program simply didn't do anything.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jython234/groupme-discord-bridge/issues/1#issuecomment-405613116, or mute the thread https://github.com/notifications/unsubscribe-auth/AFtT5gjJB5DEGLg6iRjIWWWmm4d-o03gks5uHfuhgaJpZM4VOOj- .

abcasada commented 6 years ago

Big thumbs up for "more clean and documented," haha. Any timeline on that? I'm probably gonna try to get this set up for me tonight but if you're almost done with a rewrite I could wait a couple days

alejzeis commented 6 years ago

I think it will be ready within a few days.

On Wed, Jul 25, 2018, 10:36 abcasada notifications@github.com wrote:

Big thumbs up for "more clean and documented," haha. Any timeline on that? I'm probably gonna try to get this set up for me tonight but if you're almost done with a rewrite I could wait a couple days

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jython234/groupme-discord-bridge/issues/1#issuecomment-407798154, or mute the thread https://github.com/notifications/unsubscribe-auth/AFtT5pEhT0E8QjZpfPqQmqHxkZXamNYoks5uKJCPgaJpZM4VOOj- .

alejzeis commented 6 years ago

Update: I've looked at the code and there really isn't anything to rewrite at all. I've gone ahead and updated the dependencies as there were some security vulnerabilities. I'm working on writing a setup guide in the README so people can actually set the bridge up for themselves.

alejzeis commented 6 years ago

README has been updated with a setup guide. I've re-set up my own bridge following the steps and it works correctly. I've also made some small changes to the code, probably the biggest is removing "callbackURLPrefix" which was confusing and simply making it "callbackURL" to set the whole callback URL that the bridge will listen on, (it's explained better in the README).

I think everything should be good to go, let me know if there are any additional problems, I'll be happy to help.

A Notice, If you tried the bridge before and it wasn't working, please re-download the project and start from scratch using the new code as that might help.

abcasada commented 6 years ago

Great, I'm looking forward to trying to get it going tonight. Thanks for doing the README, that should be a lot of help.

jdas1996 commented 3 years ago

I am still having trouble understanding the server portion and would appreciate the help. I set up a server using Vultr, I don't have any firewall setup, so felt no need to open a port. So I kept the listenport at 8088. Installed the files on the server and it currently says "Discord Client Ready"

But I don't know what URL to put in the Callback URL field in the GroupMe Developers website.

alejzeis commented 3 years ago

@jdas1996 Assuming you've already set the discord settings in the config file (such as the bot token, username, guild and channel IDs):

The callback URL on the GroupMe site should be in the form of http://[Your server IP or domain]:8088/callback That should get it working. Then of course you need to set the GroupMe name, botId and token in the config file.

If you care about security however it's recommended you run a webserver such as Nginx or Apache on the server with an SSL cert so you can use HTTPS. You can then configure Nginx to forward requests from https://myserver.xyz/callback to "localhost:8088/callback", this is called a Reverse Proxy.

That way all the GroupMe messages sent from the GroupMe service to the bridge bot are encrypted over HTTPS, and then Nginx takes those HTTPS requests and passes them to localhost where the bot is running. There's a lot of guides on how to set this up, I can send more detailed instructions on how to do this if you are interested.