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-spoiler-bot

v2.0.6

Published

A bot for Discord that replaces spoiler messages with GIFs that reveal content on hover.

Downloads

47

Readme

Discord Spoiler Bot

npm npm npm dependencies

A Discord bot that replaces spoiler messages with GIFs that reveal content on hover.

Demo

Single line

Discord Spoiler Bot in action

Multi-line

Discord Spoiler Bot with multi-line comments

Marking someone else's message as a spoiler

Discord Spoiler Bot marking other messages as spoilers

Documentation

Check Discord Spoiler Bot Wiki on GitHub for full documentation. See section below for the quick start guide.

Quick start

If you know what you're doing, you can jump right in. First, make sure you have all prerequisites for node-canvas installed. Then add Discord Spoiler Bot to your npm project:

$ npm install discord-spoiler-bot --save

Now get a secret token for your bot and make sure the bot has permission to read, write and delete messages as well as upload files. Create a file called index.js and put the following inside:

'use strict';

const SpoilerBot = require('discord-spoiler-bot');

let config = {
    token: 'you_secret_token_here',
};

let bot = new SpoilerBot(config);
bot.connect();

Launch your bot using Node.js:

$ node index.js

And you're done! Write messages of format <topic>:spoiler:<content> to mark your own messages as spoilers, e.g.:

FMA:spoiler:Elric brothers are alchemists!

To mark someone else's messages, use <message-id>:spoils:<topic>, but you will have to configure permissions first. See Configuration section.

Already have a bot running on discord.js or discord.io? You can supply an instance of Client instead of a token, see Usage section for examples.

Reporting bugs

Please create an issue thread here. I will try to reply and resolve issues to the best of my ability.

Known issues

  • It's been reported that GIFs play continuously on mobile devices instead of stopping after revealing the spoiler. Sadly this is a limitation of the mobile Discord app and I can't do anything about it.
  • On Windows, node-canvas library does not support true type fonts so Discord Spoiler Bot uses the default node-canvas font instead of Source Sans Pro Regular.

Contributing

I believe this bot is feature-complete, and from now on will most likely only fix bugs. Before adding a new feature to this bot and creating a pull request, make sure said feature makes sense in the context of Discord Spoiler Bot.

Make sure npm test and npm run lint return no errors before making a pull request, otherwise I might reject it. npm run test-no-delete is available for your convenience, running this command will make sure that GIFs produced during testing are not removed so you can inspect them for any artifacts.