-
-
Notifications
You must be signed in to change notification settings - Fork 187
/
Copy pathsubclassed_module_1.py
47 lines (32 loc) · 1.11 KB
/
subclassed_module_1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""
jishaku subclassing test 1
~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a valid extension file for discord.py intended to
discover weird behaviors related to subclassing.
This variant overrides behavior using a Feature.
:copyright: (c) 2021 Devon (scarletcafe) R
:license: MIT, see LICENSE for more details.
"""
from discord.ext import commands
import jishaku
from jishaku.types import ContextT
class ThirdPartyFeature(jishaku.Feature):
"""
overriding feature for test
"""
@jishaku.Feature.Command(name="jishaku", aliases=["jsk"], invoke_without_command=True, ignore_extra=False)
async def jsk(self, ctx: ContextT):
"""
override test
"""
return await ctx.send("The behavior of this command has been overridden with a third party feature.")
class Magnet1(ThirdPartyFeature, *jishaku.OPTIONAL_FEATURES, *jishaku.STANDARD_FEATURES): # pylint: disable=too-few-public-methods
"""
The extended Jishaku cog
"""
async def setup(bot: commands.Bot):
"""
The setup function for the extended cog
"""
await bot.add_cog(Magnet1(bot=bot))