File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,39 @@ async def test(ctx: dico_command.Context):
1818
1919bot.run()
2020```
21+
22+ ### Using Addon/module:
23+
24+ main.py:
25+ ``` py
26+ import dico
27+ import dico_command
28+
29+ bot = dico_command.Bot(" YOUR_TOKEN_HERE" , " !" , intents = dico.Intents.full())
30+ bot.load_module(" addons.test" )
31+ bot.run()
32+ ```
33+
34+ addons/test.py:
35+ ``` py
36+ import dico_command
37+
38+
39+ class AddonTest (dico_command .Addon , name = " Addon Test" ):
40+ @dico_command.command (name = " addon" )
41+ async def example (self , ctx : dico_command.Context):
42+ await ctx.send(f " Hello! This is addon ` { self .name} `. " )
43+
44+
45+ def load (bot ):
46+ # Implementing function `load` is required. You may do any actions here.
47+ bot.load_addons(AddonTest)
48+
49+
50+ def unload (bot ):
51+ # Implementing function `unload` is required. You may do any actions here.
52+ bot.unload_addons(AddonTest)
53+
54+ ```
55+
2156Note that using async is forced unlike dico itself.
You can’t perform that action at this time.
0 commit comments