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

nodebb-plugin-discord-bot

v0.0.7

Published

A NodeBB plugin that integrates with discord and gives notifications of new posts

Downloads

13

Readme

Discord Bot

Version Dependencies

A bot for discord that integrates with NodeBB and gives notifications of new posts.

npm install nodebb-plugin-discord-bot

Your bots account details can be added along with the channel ID you wish it to post in in the admin area or via environment variables.

export DISCORD_BOT_EMAIL="xxxxx"
export DISCORD_BOT_PASSWORD="yyyyy"
export DISCORD_BOT_CHANNEL="zzzzz"

To get the channel ID coppy the link to the channel and the number you need is the last long number IE for https://discordapp.com/channels/167038734745862144/167038734745862144 the id number would be 167038734745862144.

The welcome message that is sent to any member that joins a server can be set in the admin area or via a hook as documented bellow.

##Files The plugin will generate a file named tenc in the nodebb root please make sure it can as this is where it stores the discord auth token.

##Hooks

The plugin has hooks you can use just as you would do normal NodeBB hooks.

###filter:nodebbbot.helpmessage filter:nodebbbot.helpmessage passes helpMessage as string you should append the help message for your plugin to it.

###filter:nodebbbot.command.reply filter:nodebbbot.command.reply passes command, replies, fromDiscordUser and fromDiscordUserID

  • command is a string it contains what ever the user sent to your bot minus the @bot and with any white space around the string trimmed.
  • replies is an array of all the messages that the bot will be send to the channel that the command was said in please .push() your reply on to it.
  • fromDiscordUser is a string containing the discord usename of the user that sent the command.
  • fromDiscordUserID is a string containing the discord ID of the user that sent the command.

###static:nodebbbot.newmemberjoined static:nodebbbot.newmemberjoined passes discordUsername and discordUserID when ever a user connects to any server that your bot is in.

  • discordUsername is a string containing the discord usename of the user that sent the command.
  • discordUserID is a string containing the discord ID of the user that sent the command.

###filter:nodebbbot.welcome.message filter:nodebbbot.welcome.message passes discordUsername, discordUserID and welcomeMessage overwrite welcomeMessage as you wish it will be direct message to the user

  • discordUsername is a string containing the discord usename of the user that sent the command.
  • discordUserID is a string containing the discord ID of the user that sent the command.
  • welcomeMessage is a string containing an the current welcome message overwrite at will.