Skip to content

Commit

Permalink
docs: update for 4.0.1 unstable info
Browse files Browse the repository at this point in the history
  • Loading branch information
V3ntus committed Jan 11, 2022
1 parent d2085d3 commit 670c7c8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@
![image](https://user-images.githubusercontent.com/29584664/146406854-88c2dfa8-d346-437e-a57b-1fc73be45b65.png)

# Overview
*As of discord-py-interactions v4.0.1, cog support is still in a planned stage and not supported. Until they are added, command modules will be in place of cogs*
> `main.py:`
- A custom, dynamic cog loader is present. Write a cog following the `template.py` in `/cogs/`, place it in the `/cogs/` directory, and it will automatically be loaded when the bot boots.
- Utilizes the logging library and implements an easy to use custom logger and formatter. All you need to do is call `initLogger("script_name")` in a module or cog, and log configuration is taken care of for you.
- Alongside the custom logging utility, exception handling is present and proper debug levels exist. You can configure the level to your liking in `config.py`. Also, this handles command cooldown if you define it in your cogs.
- A custom, dynamic command module loader is present. Write a command module following the `template.py` in `/cogs/`, place it in the `/cogs/` directory, and it will automatically be loaded when the bot boots.
- Utilizes the logging library and implements an easy to use custom logger and formatter. All you need to do is call `initLogger("script_name")` in a module, and log configuration is taken care of for you.
- Alongside the custom logging utility, exception handling is present and proper debug levels exist. You can configure the level to your liking in `config.py`.

> `src/logutil.py:`
- Functions here exist to aid the user in simplifying `logging` configuration. Here, all log messages go to standard output.
- A custom formatter also applies based on what level logging you desire, whereas DEBUG produces verbose output and is tailored to aid in debugging, showing which module the message is originating from and, in most cases, which line number. Loggging levels are categorized by color.

> `cogs/template.py:`
- This example cog is documented extensively. Please be sure to read over it. This cog will *not* be loaded on boot, so please refrain from writing your code in it.
- This example command module is documented extensively. Please be sure to read over it. This command module will *not* be loaded on boot, so please refrain from writing your code in it.

> `config.py:`
- This module houses the basic configuration options for your bot, including DEBUG switches and the bot prefix.
- This module houses the basic DEBUG log configuration

# Installation
> 1. Clone this repository. To switch to a different version, `cd` into this cloned repository and run `git checkout -b [branch name/version here]`
Expand All @@ -44,9 +45,7 @@
> **Register it for slash commands:**
> - Under *OAuth2 > General*, set the Authorization Method to "In-app Authorization"
> - Tick `bot` and `applications.commands`
> - Go to *OAuth2 > URL Generator*, tick `bot` and `applications.commands`. For Bot Permissions, tick:
> > - General: Read Messages/View Channels
> > - Text Permissions: Send Messages, Manage Messages, and Embed Links
> - Go to *OAuth2 > URL Generator*, tick `bot` and `applications.commands`
> - Copy the generated URL at the bottom of the page to invite it to desired servers
> 4. Make a new file called `.env` inside the repo folder and paste the below code block in the file
> ```
Expand All @@ -63,10 +62,13 @@
> *If you get errors related to missing token environment variables, run `source .env`*
# FAQ
## What happened to message commands?
> As of discord-py-interactions v4, they have been removed. However, it is still possible to code them in, I have not included that option yet
## Why aren't my slash commands getting registered?
> There could be many reasons, but let's narrow it down
> - Ensure your bot token has the `applications.command` scope before you invited your bot. If not, kick the bot from your server(s), follow above directions to enable the permissions scope, and reinvite.
> - The bot uses a guild ID to register the slash commands in a single guild. This ensures it will be registered instantly. In order to use slash commands globally, remove the `guild_ids=[]` in your `@cog_ext.cog_slash` decorators. But **keep in mind this may take a few hours to register.** To refresh it instantly, simply kick the bot from your server and reinvite.
> - The bot uses a guild ID to register the slash commands in a single guild. This ensures it will be registered instantly. In order to use slash commands globally, set the `DEV_GUILD` in your `.env` to an empty string. But **keep in mind this may take a few hours to register.** To refresh it instantly, simply kick the bot from your server and reinvite.
<hr />
Expand Down

0 comments on commit 670c7c8

Please sign in to comment.