MessageHandler
This is a discord handler for people who use discord.Client but want to use the bot like discord.ext that is developed by Tim232.
Example :
main.py
import discord
from handler import Handler
client = discord.Client()
mHandler = Handler(client=client, directory="modules", prefix="!", help_command=True)
@client.event
async def on_ready():
print(client.user.id)
@client.event
async def on_message(message):
await mHandler.process_messages(message)
client.run("token")
modules/test.py
import discord
async def run(client, message):
if message.content.startswith("!Test"):
await message.channel.send("Example")
await message.channel.send(client.user.avatar_url)
if message.content == "!example":
await message.channel.send("Test")
content_key = ["!example"]
startswith_key = ["!Test"]
- The handler automatically generates
{prefix}helpcommand if client'shelp_commandisTrue.
Metadata
Release files for MessageHandler 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| MessageHandler-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / MessageHandler-1.0.2-py3-none-any.whl
| Download URL | MessageHandler-1.0.2-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
662c99a4f1e18c566a436c56fb4b06f7f57d479358d43a73eca1e8569fbf998a
|
|
BLAKE2b-256 checksum How to use checksums |
98be21bfa45cae067a873c99b2a5aa361392d5f57ff004b86cf2f00e75628321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
|