Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrrfv/discord-webhook-qotd-bot
Discord bot that sends a "question of the day" every 24 hours
https://github.com/mrrfv/discord-webhook-qotd-bot
discord discord-bot discord-fun discord-webhook discord-webhooks fun games qotd question-of-the-day webhook webhooks
Last synced: 20 days ago
JSON representation
Discord bot that sends a "question of the day" every 24 hours
- Host: GitHub
- URL: https://github.com/mrrfv/discord-webhook-qotd-bot
- Owner: mrrfv
- License: bsd-3-clause
- Created: 2023-04-09T20:01:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-20T18:52:00.000Z (5 months ago)
- Last Synced: 2024-10-11T02:28:03.117Z (about 1 month ago)
- Topics: discord, discord-bot, discord-fun, discord-webhook, discord-webhooks, fun, games, qotd, question-of-the-day, webhook, webhooks
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Question of the Day Bot
This is a Node.js application that utilizes a discord webhook to post a question of the day from a file to a Discord channel. It reads a JSON object containing an array of questions and posts one question according to your schedule.
## Usage
1. Include your own questions in `questions.json`. A format is included in `questions.json.format`.
2. Run `npm install` to install dependencies.
3. Copy `.env.example` to `.env` and fill in the values.
4. Run `node index.js`.## Docker
You can also run this bot in a Docker container. To do so, use the following commands:
```bash
# Create progress.txt file
cat 0 > "$(pwd)"/progress.txt
# Make sure to also create the questions.json file in the same directory# Run the image
docker run -d \
-e WEBHOOK_URL="enter webhook url here" \
-e CRON_SCHEDULE="enter cron schedule here" \
-e OPTIONAL_MESSAGE_CONTENT="" \
-e TZ="Europe/Berlin" \
--mount type=bind,source="$(pwd)"/questions.json,target=/app/questions.json,readonly \
--mount type=bind,source="$(pwd)"/progress.txt,target=/app/progress.txt \
--restart always \
--name qotdbot \
mrrfv/discord-webhook-qotd-bot:latest
```The command above expects that the progress.txt and questions.json files already exist, and that they are in the current directory. Change the value of the `TZ` environment variable for message scheduling to work properly.
## License
BSD 3-Clause License. See `LICENSE` for more information.