npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

discord-jabber-transport-bot

v5.4.0

Published

Simple bridge bot between Discord channel and Jabber conference (XMPP MUC)

Downloads

9

Readme

discord-jabber-transport-bot

Simple transport bot between Discord channel and Jabber (XMPP MUC) conference. You can join several conferences on one bot instance.

How to start

  • You need a working installation of Node.js (version >= 7.7.1) on the machine this bot will run on. npm is installed with Node.js.
  • Install dependencies: npm ci.
  • Create configuration file: cp config/development.cjson.sample config/development.cjson. Create production.cjson for production mode (NODE_ENV=production).
  • Edit configuration files. See section Adding Bot to Discord Guild below.
  • Start application: nodejs ./app.js or npm start.
  • Type !ping in Discord channel to check "pong" answer.

Adding Bot to Discord Guild

  1. You need to create an application on My Apps page.

  2. Create an invitation URL as described on Bot Authorization Flow documentation page. For ease of use, it is recommended to use this website: https://discordapi.com/permissions.html.

    Bot requires 3 permissions: READ_MESSAGES, SEND_MESSAGES, EMBED_LINKS.

    There are two optional permissions: MANAGE_CHANNELS and MANAGE_WEBHOOKS (both requires Two-Factor Authentication).

    Set MANAGE_CHANNELS if you want to bot set channel topic from jabber to Discord (one way sync).

    Set MANAGE_WEBHOOKS permission if you want to bot send messages to Discord on behalf of jabber user nickname.

  3. You need to navigate to this URL, you'll be prompted to add the bot to a guild in which you have proper permissions. On acceptance, the bot will be added.

Debugging

Set environment variable DEBUG to values according to debug package documentation. This application uses values: info, error, error:app, error:jabber, error:discord, debug:app, debug:jabber, debug:discord.

For example, run in Linux terminal:

  • $> export DEBUG=*,-xmpp:client
  • $> node app.js

If DEBUG is not set then it sets to log all except debug settings: app.js#L3-L5.

Docker

Also you can run it in a docker container:

  1. cd ~/projects/discord-xmpp-transport-bot
  2. sudo docker run --rm -it -v $(pwd):/src:rw mkenney/npm:node-7.7-alpine "npm ci"
  3. sudo docker run --rm -it -v $(pwd):/src:ro mkenney/npm:node-7.7-alpine "npm run start-debug"

Or use Dockerfile:

  1. Build the image: sudo docker build -t discord-xmpp-transport-image .
  2. Run the container: sudo docker run -it --rm --name dscrd-xmpp-brdg -e NODE_ENV=production -e DEBUG=info,error:*,debug:* discord-xmpp-transport-image

Run using docker-compose:

  • Development mode: sudo docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
  • Production mode: sudo docker-compose up --build -d

Bot commands

All commands work only from Discord side. The bot answers visible only in Discord.

|Command|Description|Where works| |---|---|---| |!ping|Answers «pong».|Direct Message, Room| |!say <room> Text|Say something behalf of the bot. You can use jabber conference or Discord room ID as parameter (see !rooms command). This command only works for bot admin (adminId in the config file)|DM, Room| |!rooms|Show linked jabber conferences|DM, Room| |!users|Show users from linked jabber conference. Also, show who is ignored by !ignore command|Room| |!ignore JabberUsername|Ignore user from jabber by a nickname. If he changes nickname → he will be ignored with a new nickname.|Room| |!unignore JabberUsername or !dont_ignore JabberUsername|Stop ignoring some user|Room|