discord-message-scheduler
discord-message-scheduler copied to clipboard
A simple Discord Bot that can send scheduled messages.
Discord Message Scheduler
A simple Discord Bot that can send scheduled messages.
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
-
About The Project
- Features
- Built With
-
Getting Started
- Prerequisites
- Installation
- Usage
- Docker (experimental)
- Commands Guide
- Roadmap
- Contributing
- License
- Contact
- Acknowledgments
About The Project

Discord Message Scheduler provides a convenient bot interface to grant users the ability to create scheduled messages via the bot.
(back to top)
Features
- Supports both prefixed and slash commands
- Uses SQLite database
- Modern Discord Modal interface
- Easy to set up
- Docker support
Built With
(back to top)
Getting Started
Follow these instructions to deploy your own Discord Message Scheduler bot.
Prerequisites
This bot is build on Python 3.10. You will need to download the latest version of Python using any of the methods below.
- From official website (Any OS): https://www.python.org/downloads/.
- Using Homebrew (MacOS/Linux):
brew install [email protected] - Using APT (Debian/Ubuntu):
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.10 python3.10-dev software-properties-common curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
You will also need a Discord bot.
- Create a Discord application at https://discord.com/developers/applications
- Within the settings page, navigate to the Bot tab and create a bot
- (Optional) If you don't want others to invite your bot, then disable PUBLIC BOT.
- Enable SERVER MEMBERS INTENT and MESSAGE CONTENT INTENT under the Privileged Gateway Intents settings
- Navigate to Oauth2 → URL Generator tab, click both bot and applications.commands, and check the following buttons:
- Read Messages/View Channels
- Send Messages
- Send Messages in Thread
- Send TTS Messages
- Embed Links
- Attach Files
- Read Message History
- Mention Everyone
- Use External Emojis
- Use External Stickers
- Add Reactions
- Use Slash Commands
- Open the link in the Generated URL box at the bottom to invite your bot.
Installation
- Clone or download the repo
git clone https://github.com/Taaku18/discord-message-scheduler.git - Install Python dependencies, choose a method from below:
- (Recommended) Using PDM
- Install PDM
- Run
pdm install --prod -G speed --no-lock --no-editable
- Using pip
python3.10 -m pip install -U pip python3.10 -m pip install -U -r requirements.txt
- (Recommended) Using PDM
- Rename
.env.exampleto.envand replaceBOT-TOKENwith your bot's token andBOT-PREFIXwith your desired bot prefix. Example.envfile:TOKEN=VTDkXNDUzC3KyFoIxNzYx2_d4OQ.PK5K1A.9p0q3Kdi26j0eCa_vu3Ke_39KsL3Kkso83E_gB0 PREFIX=? SYNC_SLASH_COMMANDS=onSYNC_SLASH_COMMANDSshould be set to "on" the first time you start the bot and every time you update. It should be set to "off" during normal usage since syncing slash commands may take a long time.
(back to top)
Usage
To start the bot, simply run:
python3.10 start.py
(back to top)
Docker (experimental)
Alternatively, you can use Docker to deploy this bot.
Ensure you have the latest version of Docker installed (v19.03.0+). You will also need the Docker Compose Plugin.
Pre-built images are provided at taaku18/dms.
- Clone or download the repo
git clone https://github.com/Taaku18/discord-message-scheduler.git - Rename
.env.exampleto.envand set your environment variables (see step 3 above) - Deploy your bot (this will use the pre-built image provided for
amd64andarm64)
If you wish to build your own image instead, replacedocker pull taaku18/dms:stable docker compose up -dtaaku18/dms:stablewithdms:latestindocker-compose.yml. Then rundocker build -t dms:latest . docker compose up -d
You can stop the bot by running docker compose down.
To access your bot logs, run docker ps. This will show a list of containers.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
58e6aao4c8bd dms:latest "python start.py" 14 seconds ago Up Less than a second discord-message-scheduler
Find the CONTAINER ID of the container named "discord-message-scheduler" and run docker logs <CONTAINER ID>.
Docker Tags
latest- the most recent commit onmainstable- the most recent published tag commitx.y.z- versionx.y.ztag commit
The default tag is stable. To use a different tag, replace the "stable" of taaku18/dms:stable with your desired tag in docker-compose.yml.
(back to top)
Commands Guide
This bot accepts both prefixed and slash commands.
Table of Contents
- Schedule related:
/schedule create/schedule list/schedule show/schedule edit/schedule delete
- General:
/info=help(only prefixed command)
The default bot prefix is
=.
[arg] - Optional
<arg> - Required
/schedule create [channel]
Creates a scheduled message. You can optionally supply a channel argument to specify a channel for the message.
A Discord modal prompt will open, asking for the following:
-
Message- The message that the bot should send at the scheduled time. -
Scheduled Time- The time to send the message, accurate to the second.Formats:
- Just date:
2/24/2023(Month/Day/Year),December 12,nov 26 2023 - Just time:
1:12am,midnight,13:42,7pm - Date and time:
02/24/23 19:31:03 - Other date formats:
March 30 2023 4:10pm - Simple time:
tomorrow,next week,thursday at noon - Slightly complicated relative time:
in 1 day, 2 hours and 10 minutes - ISO 8601 format:
2023-08-11T01:59:41.981897
- Just date:
-
Timezone- The timezone to parse your time.Formats:
- Formal TZ database name:
America/Los_Angeles,Europe/Berlin,Asia/Shanghai - Time zone abbreviation:
GMT,UTC,CEST,PDT,EST,ET(not recommended, may be inaccurate) - Timezone offset:
+12:30,-3000,+0123,UTC+1232,UTC-12:32
- Formal TZ database name:
-
Repeat- The number of minutes between every repeat of the scheduled message. Set0to disable.
/schedule list [channel]
Shows you a list of upcoming scheduled messages. You can optionally supply a channel argument to specify a channel to check for your upcoming scheduled messages.
/schedule show <event-id>
Shows you the full details of a scheduled message. To find the event-id, use the /schedule list command.
/schedule edit <event-id> [new-channel]
Due to limitations with the bot, it is not possible to edit the time or timezone. You will need to delete and re-create the schedule event.
Edits the contents of an upcoming scheduled message. To find the event-id, use the /schedule list command.
To change the current channel, set new-channel to the channel that you want.
/schedule delete <event-id>
Deletes/un-schedules an upcoming scheduled message. To find the event-id, use the /schedule list command.
/info
Shows info about this bot.
=help [category-or-command]
This command is only available as a prefixed command.
Shows the help page. Optionally, set category-or-command to be a category or command name to view more info on the subject.
Note: [category-or-command] is case-sensitive.
(back to top)
Roadmap
- [x] Basic help and schedule command interfaces
- [x] Create a Docker image
- [x] Implement list/delete command
- [ ] Allow server staff access to these commands
- [ ] Implement reporting interface to remove abusive scheduled messages
- [ ] Permissions system
- [x] Add GitHub workflow for testing, linting, building Docker image
- [x] Auto generate requirements.txt from PDM using pre-commit
- [ ] Revise pyright config, add to contributing guidelines
- [ ] Replace the README screenshot and add a bot logo
See the open issues for a full list of proposed features (and known issues).
(back to top)
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - If you made any code changes, use
black .to format the code - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
We use PDM as our dependency manager. See their installations page on how to install this tool.
- Add package:
pdm add <package name> - Update package:
pdm update <package name> - Remove package:
pdm remove <package name> - Install dependencies:
pdm sync --clean -G:all(this will also remove all non-project dependencies)
Optionally add -dG <group name> (development group) or -G <group name> (optional group) to the above commands if the package belongs to a specific group (ex. lint, speed).
When making dependencies changes, always export the requirements to requirements.txt with
pdm export --pyproject --without-hashes --prod -G:all -o requirements.txt
To simplify some common processes, such as linting with black and generating requirements.txt, we use pre-commit.
It's recommended to install pre-commit by following the quick start guide and run pre-commit run -a to run the pre-commit actions.
(back to top)
License
Distributed under GNU General Public License v3.0. See LICENSE.txt for more information.
(back to top)
Contact
Contact me via Discord:
Taku - taku#3343
Project Link: https://github.com/Taaku18/discord-message-scheduler
(back to top)
Acknowledgments
- Inspired by bjsbrar/DiscordMessageScheduler
(back to top)