Command handler for dico.
Project description
dico-command
Command handler for dico.
Note: Docs is still not ready.
Example
import dico
import dico_command
bot = dico_command.Bot("YOUR_TOKEN_HERE", "!", intents=dico.Intents.full())
@bot.command("test")
async def test(ctx: dico_command.Context):
await ctx.send("Hello, World!")
bot.run()
Using Addon/module:
main.py:
import dico
import dico_command
bot = dico_command.Bot("YOUR_TOKEN_HERE", "!", intents=dico.Intents.full())
bot.load_module("addons.test")
bot.run()
addons/test.py:
import dico_command
class AddonTest(dico_command.Addon, name="Addon Test"): # name=... is optional
@dico_command.command(name="addon")
async def example(self, ctx: dico_command.Context):
await ctx.send(f"Hello! This is addon `{self.name}`.")
def load(bot):
# Implementing function `load` is required. You may do any actions here.
bot.load_addons(AddonTest)
def unload(bot):
# Implementing function `unload` is required. You may do any actions here.
bot.unload_addons(AddonTest)
Note that using async is forced unlike dico itself.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dico-command-0.0.6.tar.gz
(8.2 kB
view hashes)
Built Distribution
Close
Hashes for dico_command-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e44b6fd543a26230f23e2ffc7bc6ad8d9b1432c343ab06a55765ccde3952fe65 |
|
MD5 | 9cc2e150cdc2dc80fb3cbce110444f14 |
|
BLAKE2b-256 | 8a352077438e5dbd31fbf066c9201cacc2f412555ea3454b9fd9aeff2555821c |