-
Create a new Application in the Discord developers portal
-
Clone this repo to your local environment
-
Run
pip install Discord
-
Make a copy & rename the
.env.example
file:cp .env.example .env
-
Paste your Discord bot token into the appropriate field of
.env
β you'll get this from the developers portal. -
Create a channel in your Discord server for the bot to post pinned messages. Paste the channel ID into the appropriate field of
.env
. (Hint: you can check the channel ID easily by typing\#name-of-channel
in the server). -
Choose a custom emoji you will use to Pin things in your discord. Paste the emoji ID into the appropriate field of
.env
. (Hint: you can check the emoji ID easily by typing\:name-of-the-emoji-you-want:
in the server). -
Invite the bot to your server and give it permission to access all the channels you're pinning from, as well as the review channel where pinned messages will be posted.
-
Run
python3 fwb_pins.py
to start the bot!- Or, if you're planning on deploying to Heroku, and have the heroku CLI installed & the repo set up to point to a heroku app, you can use the
heroku local
command.
- Or, if you're planning on deploying to Heroku, and have the heroku CLI installed & the repo set up to point to a heroku app, you can use the
Once running, you will be able to pin messages with both the custom emoji you setup, as well as the native π emoji. The messages you pin will be reposted with their information in the review channel. Additionally, any messages with 15+ reactions, will be pinned automatically. This number can be changed in the fwb_pins.py
file.
The bot will not recognize any reacts on messages sent before it was started/restarted.
You will likely want to host this on Heroku so it's always on.
This repo is ready to be deployed to Heroku.
In broad steps:
- Fork this repo - you need to own a repo to connect it to Heroku.
- Create a Heroku app.
- Set up the GitHub deploy method, linking your new app to your fork of this repo.
- Create and set the
DISCORD_BOT_TOKEN
,DISCORD_PIN_CHANNEL_ID
, andDISCORD_CUSTOM_EMOJI_IDS
environment variables for your Heroku app just like you did for the.env.example
file above. - Deploy the app.
- Remember, you might need to activate your worker dyno before anything happens: check the "Resources" tab of your Heroku app, or
heroku ps:scale worker=1
in the cli.
- Remember, you might need to activate your worker dyno before anything happens: check the "Resources" tab of your Heroku app, or
- You should be live.