Skip to content
Tim K edited this page Feb 26, 2017 · 8 revisions

Discord Spoiler Bot

Discord Spoiler Bot replaces messages containing spoilers with GIFs that reveal content when hovered. Users can mark their own messages as spoilers. The bot can also be configured to allow users to mark someone else's messages as spoilers. See examples below.

A quick start guide can be found at the bottom of this page.

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

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.