6
6
7
7
from tux .bot import Tux
8
8
from tux .ui .embeds import EmbedCreator , EmbedType
9
+ from tux .utils .flags import generate_usage
9
10
10
11
11
12
class Info (commands .Cog ):
12
13
def __init__ (self , bot : Tux ) -> None :
13
14
self .bot = bot
14
-
15
+ self .info .usage = generate_usage (self .info )
16
+ self .server .usage = generate_usage (self .server )
17
+ self .member .usage = generate_usage (self .member )
18
+ self .roles .usage = generate_usage (self .roles )
19
+ self .emotes .usage = generate_usage (self .emotes )
20
+
21
+ @commands .hybrid_group (
22
+ name = "info" ,
23
+ aliases = ["i" ],
24
+ )
15
25
@commands .guild_only ()
16
- @commands .hybrid_group (name = "info" , aliases = ["i" ], usage = "info <subcommand>" )
17
- async def info (self , ctx : commands .Context [Tux ]) -> None :
26
+ async def info (
27
+ self ,
28
+ ctx : commands .Context [Tux ],
29
+ ) -> None :
18
30
"""
19
31
Information commands.
20
32
@@ -27,8 +39,11 @@ async def info(self, ctx: commands.Context[Tux]) -> None:
27
39
if ctx .invoked_subcommand is None :
28
40
await ctx .send_help ("info" )
29
41
42
+ @info .command (
43
+ name = "server" ,
44
+ aliases = ["s" ],
45
+ )
30
46
@commands .guild_only ()
31
- @info .command (name = "server" , aliases = ["s" ], usage = "info server" )
32
47
async def server (self , ctx : commands .Context [Tux ]) -> None :
33
48
"""
34
49
Show information about the server.
@@ -68,8 +83,11 @@ async def server(self, ctx: commands.Context[Tux]) -> None:
68
83
69
84
await ctx .send (embed = embed )
70
85
86
+ @info .command (
87
+ name = "member" ,
88
+ aliases = ["m" , "user" , "u" ],
89
+ )
71
90
@commands .guild_only ()
72
- @info .command (name = "member" , aliases = ["m" , "user" , "u" ], usage = "info member [member]" )
73
91
async def member (self , ctx : commands .Context [Tux ], member : discord .Member ) -> None :
74
92
"""
75
93
Show information about a member.
@@ -113,8 +131,11 @@ async def member(self, ctx: commands.Context[Tux], member: discord.Member) -> No
113
131
114
132
await ctx .send (embed = embed )
115
133
134
+ @info .command (
135
+ name = "roles" ,
136
+ aliases = ["r" ],
137
+ )
116
138
@commands .guild_only ()
117
- @info .command (name = "roles" , aliases = ["r" ], usage = "info roles" )
118
139
async def roles (self , ctx : commands .Context [Tux ]) -> None :
119
140
"""
120
141
List all roles in the server.
@@ -131,7 +152,10 @@ async def roles(self, ctx: commands.Context[Tux]) -> None:
131
152
132
153
await self .paginated_embed (ctx , "Server Roles" , "roles" , guild .name , roles , 32 )
133
154
134
- @info .command (name = "emotes" , aliases = ["e" ], usage = "info emotes" )
155
+ @info .command (
156
+ name = "emotes" ,
157
+ aliases = ["e" ],
158
+ )
135
159
async def emotes (self , ctx : commands .Context [Tux ]) -> None :
136
160
"""
137
161
List all emotes in the server.
0 commit comments