From 33eb60474ac6732de4139a3126f8e1fbf94765ab Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 6 Sep 2020 15:22:07 +0200 Subject: [PATCH] updated README.md --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- miniscord/_bot.py | 1 - 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3433c7..7ab4ee0 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,48 @@ DISCORD_TOKEN= ## Documentation -*TODO* +### Bot init + +```python +bot = Bot( + "test-app", # name + "0.1-alpha", # version + alias="|" # respond to '|command' messages +) +``` + +### Bot configuration properties + +* `token_env_var` (default: `"DISCORD_TOKEN"`) + * Which var to read in the `.env` file. +* `remove_mentions` (default: `True`) + * Remove any mention in the message / arguments. +* `any_mention` (default: `False`) + * If the bot respond to a mention in the middle of messages. +* `log_calls` (default: `False`) + * Log any calls to the Python logging. +* `guild_logs_file` (default: `"guilds.log"`) + * Log guilds join/leave on a file. +* `enforce_write_permission` (default: `True`) + * If the bot can't respond on a channel it was called, it sends a DM to the caller. +* `lower_command_names` (default: `True`) + * Use lowercase on command names (if false, commands are case-sensitive). +* `game_change_delay` (default: `10`) + * Change the game status every n seconds. +* `error_restart_delay` (default: `2`) + * On crash, restart after n seconds. + +### Registering commands + +TODO + +### Game status + +TODO + +### Exposed utility functions + +TODO ## Versions diff --git a/miniscord/_bot.py b/miniscord/_bot.py index 42843d0..fa17851 100644 --- a/miniscord/_bot.py +++ b/miniscord/_bot.py @@ -181,7 +181,6 @@ class Bot(object): if self.guild_logs_file is not None: with open(self.guild_logs_file, encoding="utf-8", mode="a") as f: f.write(f"{datetime.now():%Y-%m-%d %H:%M} -{guild.id}: {guild.name}\n") - pass def register_command(self, regex: str, compute: CommandFunction, help_short: str, help_long: str): if not regex.startswith("^"):