Compare commits
2 Commits
798f5ac529
...
498d822e09
Author | SHA1 | Date | |
---|---|---|---|
498d822e09
|
|||
44e144801d
|
52
README.md
52
README.md
@@ -1,2 +1,54 @@
|
||||
# QuizBot
|
||||
|
||||
Open source Discord bot for quizzes and quest-like events.
|
||||
|
||||
## Installation
|
||||
|
||||
### Dependencies
|
||||
|
||||
- [Python 3.11+](https://www.python.org)
|
||||
- [MongoDB](https://www.mongodb.com)
|
||||
- [Redis](https://redis.io)/[Valkey](https://valkey.io) or [Memcached](https://memcached.org) (used for caching,
|
||||
optional)
|
||||
- [Git](https://git-scm.com) (only if installing from source)
|
||||
|
||||
### Installation from release
|
||||
|
||||
1. Download the release archive from [Releases](https://git.end-play.xyz/profitroll/QuizBot/releases)
|
||||
2. Unpack the archive to a folder of your choice
|
||||
3. Go to the project folder
|
||||
4. Create a virtual environment: `python3 -m venv .venv`
|
||||
5. Activate virtual environment:
|
||||
- Linux: `source .venv/bin/activate`
|
||||
- Windows (cmd): `.venv/bin/activate.bat`
|
||||
- Windows (PowerShell): `.venv/bin/activate.ps1`
|
||||
6. Install requirements: `pip install -r requirements.txt`
|
||||
7. Copy example config to a real file: `cp config_example.json config.json`
|
||||
8. Configure the bot (see [Configuration](#configuration))
|
||||
9. Start the bot: `python main.py`
|
||||
|
||||
### Installation from source
|
||||
|
||||
1. Clone the repository: `git clone https://git.end-play.xyz/profitroll/QuizBot.git`
|
||||
2. Go to the project's folder: `cd QuizBot`
|
||||
3. Continue from step 4 of [Installation from release](#installation-from-release)
|
||||
|
||||
## Configuration
|
||||
|
||||
TODO
|
||||
|
||||
## Upgrading
|
||||
|
||||
TODO
|
||||
|
||||
## Usage
|
||||
|
||||
1. Invite the bot to your server with permissions `137707834448` and `applications.commands` scope.
|
||||
You can also use the following URL template to invite your bot after replacing `CLIENT_ID` with you bot's client
|
||||
ID:
|
||||
`https://discord.com/oauth2/authorize?client_id=CLIENT_ID&permissions=137707834448&integration_type=0&scope=applications.commands+bot`
|
||||
2. Go to "Server Settings > Integrations > QuizBot" and disable access to admin commands for you default role.
|
||||
Only admins should have access to following commands: `/config`, `/event`, `/stage` and `/user`.
|
||||
Allowing access to `/status` is not recommended, however won't do any harm if done so.
|
||||
3. Configure bot for usage on your server using `/config set` providing all the necessary arguments.
|
||||
Timezones are compatible with summer time (e.g. `CET` will be interpreted as `CEST` during summer time).
|
@@ -102,7 +102,7 @@ class PycordBot(LibPycordBot):
|
||||
await self.notify_admins(
|
||||
guild,
|
||||
pycord_guild,
|
||||
self.bot._("admin_event_no_stages_defined", "messages").format(event_name=event.name),
|
||||
self._("admin_event_no_stages_defined", "messages").format(event_name=event.name),
|
||||
)
|
||||
|
||||
await event.cancel(self.cache)
|
||||
@@ -133,7 +133,7 @@ class PycordBot(LibPycordBot):
|
||||
await self.notify_admins(
|
||||
guild,
|
||||
pycord_guild,
|
||||
self.bot._("admin_channel_creation_failed_no_user", "messages").format(
|
||||
self._("admin_channel_creation_failed_no_user", "messages").format(
|
||||
user_id=user.id, event_name=event.name
|
||||
),
|
||||
)
|
||||
@@ -153,7 +153,7 @@ class PycordBot(LibPycordBot):
|
||||
await self.notify_admins(
|
||||
guild,
|
||||
pycord_guild,
|
||||
self.bot._("admin_channel_creation_failed", "messages").format(
|
||||
self._("admin_channel_creation_failed", "messages").format(
|
||||
display_name=discord_user.display_name,
|
||||
mention=discord_user.mention,
|
||||
event_name=event.name,
|
||||
@@ -169,7 +169,7 @@ class PycordBot(LibPycordBot):
|
||||
)
|
||||
|
||||
await user_channel.send(
|
||||
self.bot._("event_is_starting", "messages").format(event_name=event.name),
|
||||
self._("event_is_starting", "messages").format(event_name=event.name),
|
||||
file=thumbnail,
|
||||
)
|
||||
|
||||
@@ -186,7 +186,7 @@ class PycordBot(LibPycordBot):
|
||||
await self.notify_admins(
|
||||
guild,
|
||||
pycord_guild,
|
||||
self.bot._("admin_event_started", "messages").format(event_name=event.name),
|
||||
self._("admin_event_started", "messages").format(event_name=event.name),
|
||||
)
|
||||
|
||||
async def _process_events_end(self) -> None:
|
||||
@@ -221,9 +221,7 @@ class PycordBot(LibPycordBot):
|
||||
continue
|
||||
|
||||
stages_string: str = "\n\n".join(
|
||||
self.bot._("stage_entry", "messages").format(
|
||||
sequence=stage.sequence + 1, answer=stage.answer
|
||||
)
|
||||
self._("stage_entry", "messages").format(sequence=stage.sequence + 1, answer=stage.answer)
|
||||
for stage in stages
|
||||
)
|
||||
|
||||
@@ -242,7 +240,7 @@ class PycordBot(LibPycordBot):
|
||||
# Send a notification about event start
|
||||
user_channel: TextChannel = guild.get_channel(user.event_channels[str(event._id)])
|
||||
|
||||
event_ended_string: str = self.bot._("event_ended", "messages").format(
|
||||
event_ended_string: str = self._("event_ended", "messages").format(
|
||||
event_name=event.name, stages=stages_string
|
||||
)
|
||||
|
||||
@@ -262,7 +260,7 @@ class PycordBot(LibPycordBot):
|
||||
await self.notify_admins(
|
||||
guild,
|
||||
pycord_guild,
|
||||
self.bot._("admin_event_ended", "messages").format(event_name=event.name),
|
||||
self._("admin_event_ended", "messages").format(event_name=event.name),
|
||||
)
|
||||
|
||||
await event.end(cache=self.cache)
|
||||
|
Reference in New Issue
Block a user