66
77from tux .bot import Tux
88from tux .ui .embeds import EmbedCreator , EmbedType
9+ from tux .utils .flags import generate_usage
910
1011
1112class Info (commands .Cog ):
1213 def __init__ (self , bot : Tux ) -> None :
1314 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+ )
1525 @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 :
1830 """
1931 Information commands.
2032
@@ -27,8 +39,11 @@ async def info(self, ctx: commands.Context[Tux]) -> None:
2739 if ctx .invoked_subcommand is None :
2840 await ctx .send_help ("info" )
2941
42+ @info .command (
43+ name = "server" ,
44+ aliases = ["s" ],
45+ )
3046 @commands .guild_only ()
31- @info .command (name = "server" , aliases = ["s" ], usage = "info server" )
3247 async def server (self , ctx : commands .Context [Tux ]) -> None :
3348 """
3449 Show information about the server.
@@ -68,8 +83,11 @@ async def server(self, ctx: commands.Context[Tux]) -> None:
6883
6984 await ctx .send (embed = embed )
7085
86+ @info .command (
87+ name = "member" ,
88+ aliases = ["m" , "user" , "u" ],
89+ )
7190 @commands .guild_only ()
72- @info .command (name = "member" , aliases = ["m" , "user" , "u" ], usage = "info member [member]" )
7391 async def member (self , ctx : commands .Context [Tux ], member : discord .Member ) -> None :
7492 """
7593 Show information about a member.
@@ -113,8 +131,11 @@ async def member(self, ctx: commands.Context[Tux], member: discord.Member) -> No
113131
114132 await ctx .send (embed = embed )
115133
134+ @info .command (
135+ name = "roles" ,
136+ aliases = ["r" ],
137+ )
116138 @commands .guild_only ()
117- @info .command (name = "roles" , aliases = ["r" ], usage = "info roles" )
118139 async def roles (self , ctx : commands .Context [Tux ]) -> None :
119140 """
120141 List all roles in the server.
@@ -131,7 +152,10 @@ async def roles(self, ctx: commands.Context[Tux]) -> None:
131152
132153 await self .paginated_embed (ctx , "Server Roles" , "roles" , guild .name , roles , 32 )
133154
134- @info .command (name = "emotes" , aliases = ["e" ], usage = "info emotes" )
155+ @info .command (
156+ name = "emotes" ,
157+ aliases = ["e" ],
158+ )
135159 async def emotes (self , ctx : commands .Context [Tux ]) -> None :
136160 """
137161 List all emotes in the server.
0 commit comments