A Discord bot that generates a static blog from posts in a channel.
The images and posts in the Discord channel will be deleted as they are posted to the blog.
I wrote this so that myself and others would be able to easily publish images to a blog. Since we already use Discord, I wanted to experiment with using it as the input mechanism.
Since this is an experiment, it's in a "mostly works" state. There are probably a bunch of unhandled edge cases and it bundles its own hardcoded theme (Blue Penguin).
- Create a Discord bot (see https://discordpy.readthedocs.io/en/latest/discord.html) with the "Message Content" privileged intent and the "Manage Messages" permissions. This allows it to read/write/delete/edit reactions to messages.
- Install
discord-to-blog
usingpip
(pip install git+https://github.com/pR0Ps/discord-to-blog
) - Create a
settings.yml
file based off the example below:
guild_name: ...
token: ...
channel: blog-posts
data_dir: ./content
output_dir: ./output
base_url: http://localhost:8000
site_name: My photo blog
timezone: America/Toronto
- Run
discord-to-blog --config <path to settings.yml>
. - Send messages to the specified channel and watch as the website is generated in the output directory.
- Serve up the output directory using a web server of some kind.
- [optional] Configure your system to run
discord-to-blog
as a service using something likesystemd
to ensure that it runs at startup, restarts if it crashes, etc.
Licensed under the GNU GPLv3