Discord.py-Console
Discord.py Console is a command line tool that allows you to control your bot and execute commands,
so you can use your Bot in the terminal/console and run Discord commands as usual.
Installation
Windows
py -3 -m pip install discord.py-Console
Linux/macOS
python3 -m pip install discord.py-Console
Usage and Example
The implementation is similar to the regular commands in discord.py. Just implement the discord.py-Console like this:
import discord
from dpyConsole import Console
client = discord.Client(intents=discord.Intents.all())
my_console = Console(client)
@client.event
async def on_ready():
print("I'm Ready")
@my_console.command()
async def hey(user: discord.User): # Library automatically converts type annotations, just like in discord.py
"""
Library can handle both synchronous or asynchronous functions
"""
print(f"Sending message to {user.name} id: = {user.id}")
await user.send(f"Hello from Console Im {client.user.name}")
my_console.start() # Starts console listener (opens new Thread to be nonblocking)
client.run("Token")
To execute the mentioned command run hey exampleUser#0001 or hey <valid_user_id>.
Links and Infos
Note: You can split up discord.py-Console commands into cogs view an example in the Example folder.
Metadata
Release files for discord.py-Console 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| discord.py-Console-0.1.2.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| discord.py_Console-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / discord.py-Console-0.1.2.tar.gz
| Download URL | discord.py-Console-0.1.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bf30174bfe5eba820df21a29cd9ab19a591d022a9678600da1ce06d1d5959a7
|
|
BLAKE2b-256 checksum How to use checksums |
a7635abae95501035511a64ae43762ab0ac302322223fbd5cbab7f735efac32a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.5
|
Release files / discord.py_Console-0.1.2-py3-none-any.whl
| Download URL | discord.py_Console-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90f811243b96989b76bc1627283e1047186b9a742f7c6c430d1697ab96d6bd6b
|
|
BLAKE2b-256 checksum How to use checksums |
8dadfa201c7a17d827cb5291233cd3bb2d76388ad19d92d6a955863c95d3b0bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.5
|