GithubHelp home page GithubHelp logo

adbelle / discord-xmpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tskubicki/discord-xmpp

0.0 1.0 0.0 19 KB

A bot for Discord that transfers chat messages between a Discord channel and a XMPP-based Multi-user Chatroom (MUC).

License: BSD 2-Clause "Simplified" License

JavaScript 100.00%

discord-xmpp's Introduction

discord-xmpp

A bot for Discord that transfers chat messages between a Discord channel and a XMPP-based Multi-user Chatroom (MUC). It runs on node.js, and utilizes discord.js, node-xmpp-client, and tinyurl.

Installation

You need all of the following before you start:

  • A working installation of Node.js on the machine this bot will run on. You can get it at https://nodejs.org
  • Access to the Discord account that created the server the Discord chatroom lives on.
  • The ID number of the Discord chatroom the bot will listen to. You can get it by logging into the web version of Discord at "discord.gg", and browsing to the chatroom. It's in the URL as the last number, like the following example: https://discordapp.com/channels/SERVER_ID/CHATROOM_ID
  • An account on the XMPP server that the bot will run under, also known as a JID (Jabber ID). It's usually something like: "username@XmppServerName"
  • The JID of the chatroom on your XMPP server. It tends to look like: "[email protected]"

Now, lets begin

  1. Log into the Discord Developer's site at "https://discordapp.com/developers/applications/me" using the server owner's account.

  2. Click on "New Application"

  3. Type a meaningful name under "APP NAME*". This is name of the bot-user XMPP chat will appear from.

  4. If you want, click on "App Icon" to upload an image for your bot to use as an avatar.

  5. When done, click "Create Application" at the bottom of the page.

  6. At the next page, click on the "click to reveal" link under "App Details"

  7. Click on the "Create a Bot User" button, and then the "Yes. Do it!" button.

  8. Under "App Bot User", click on the "click to reveal" link, and copy that token somewhere temporarily. You will need it later.

  9. Click 'Save Changes'

  10. Under "App Details", copy the "Client/Application ID" and put it somewhere for a moment, you'll need it for the next step

  11. Change the following URL to use the Client ID you just copied, and browse to it: https://discordapp.com/oauth2/authorize?client_id=PUT_YOUR_CLIENT_ID_HERE&scope=bot&permissions=0

  12. Click on the dropdown box under "Add a bot to a server", select the server your chatroom is in, and click the "Authorize" button.

  13. We're now done with the Discord side. Now to setup the bot

  14. Clone this repo to your desired folder

  15. Open your command line and browse to the folder

  16. Type "npm install --save" and press enter. This may take a few moments to complete

  17. Open "app.js" using a text editor, and turn your attention to first five lines.

  18. On line 2, replace 'YOUR_DISCORD_API_TOKEN' with the token you got earlier. Make sure to keep it in 'quotes'

  19. On line 3, replace 'YOUR_DISCORD_CHATROOM_ID' with the id of the chatroom you want this to listen on. Again, make sure to keep it in 'quotes'

  20. On line 4, replace 'username@XmppServerName/alias' with the JID and alias you want to use. (The "username@XmppServerName" is mandatory while the "/alias" is optional. Note that some setups require the alias to match the username to work properly)

  21. On line 5, replace 'YOUR_PASSWORD' with the password of the account you used on line 3.

  22. On line 6, replace '[email protected]' with the JID of the room you want this to listen on.

  23. On line 7, replace 'XmppServerName' with server name;

  24. On line 8, replace 5222 with port number of server;

  25. Save your changes

  26. Open your command line and browse to the folder

  27. Type the command "node app.js" and press enter. If you get an error about "command not found" try using "nodejs app.js" instead.

  28. If its working, you will see three messages appear in your console:

"Successfully authenticated with your_JID" "Successfully connected to XMPP chatroom" "Successfully connected to Discord"

You can also use discord-xmpp.service to install and run the process as a systemd service.

discord-xmpp's People

Contributors

adbelle avatar aelana avatar descendentstudios avatar nikitahaley avatar stormwind99 avatar tskubicki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.