diff --git a/les_louisdelatech/extensions/cats.py b/les_louisdelatech/extensions/cats.py index bc5ffd1..9499912 100644 --- a/les_louisdelatech/extensions/cats.py +++ b/les_louisdelatech/extensions/cats.py @@ -14,6 +14,7 @@ def __init__(self, bot): @commands.hybrid_command(name="cat", help="Get cat") async def get_cat(self, ctx: Context): + await ctx.defer() async with httpx.AsyncClient() as client: cat_data = await client.get("https://api.thecatapi.com/v1/images/search") diff --git a/les_louisdelatech/extensions/config.py b/les_louisdelatech/extensions/config.py index a463ba0..7c00655 100644 --- a/les_louisdelatech/extensions/config.py +++ b/les_louisdelatech/extensions/config.py @@ -7,6 +7,7 @@ def __init__(self, bot): @commands.hybrid_command(name="gteams", help="Get available teams") async def get_teams(self, ctx): + await ctx.defer() message = "Available roles :\n```" for team in self.bot.config["teams"]: diff --git a/les_louisdelatech/extensions/management.py b/les_louisdelatech/extensions/management.py index f9e47b3..f3ef6b1 100644 --- a/les_louisdelatech/extensions/management.py +++ b/les_louisdelatech/extensions/management.py @@ -14,6 +14,7 @@ async def topic( ctx, description: str = commands.parameter(description="Topic description"), ): + await ctx.defer() await ctx.channel.edit(topic=description) await ctx.send("Channel topic updated") diff --git a/les_louisdelatech/extensions/otp.py b/les_louisdelatech/extensions/otp.py index 1b77878..8120a8a 100644 --- a/les_louisdelatech/extensions/otp.py +++ b/les_louisdelatech/extensions/otp.py @@ -21,6 +21,7 @@ def __init__(self, bot): @commands.guild_only() @is_team_allowed async def list_otp(self, ctx): + await ctx.defer() try: user = User( search_user(self.bot.admin_sdk(), ctx.author.name, ctx.author.id) @@ -50,6 +51,7 @@ async def list_otp(self, ctx): async def get_otp( self, ctx, name: str = commands.parameter(description="Otp name") ): + await ctx.defer() try: user = User( search_user(self.bot.admin_sdk(), ctx.author.name, ctx.author.id) @@ -87,6 +89,7 @@ async def create_otp( digits: str = commands.parameter(description="Otp digits"), secret: str = commands.parameter(description="Otp secret"), ): + await ctx.defer() await ctx.message.delete() try: @@ -117,6 +120,7 @@ async def create_otp( async def delete_otp( self, ctx, name: str = commands.parameter(description="Otp name") ): + await ctx.defer() try: user = User( search_user(self.bot.admin_sdk(), ctx.author.name, ctx.author.id) diff --git a/les_louisdelatech/extensions/user.py b/les_louisdelatech/extensions/user.py index e162c91..975a808 100644 --- a/les_louisdelatech/extensions/user.py +++ b/les_louisdelatech/extensions/user.py @@ -52,6 +52,7 @@ async def provision( [Google] => User will be created and added to team group """ + await ctx.defer() user_email = User.email_from_name(firstname, lastname) user_team = self.bot.config["teams"].get(role_name, None) password = generate_password() @@ -165,6 +166,7 @@ async def deprovision( [Google] => User will be suspended """ + await ctx.defer() try: user = User(search_user(self.bot.admin_sdk(), member.name, member.id)) is_user_managed( @@ -205,6 +207,7 @@ async def update_team( => User will be added to this new team => User signature will be updated """ + await ctx.defer() try: user = User(search_user(self.bot.admin_sdk(), member.name, member.id)) is_user_managed( @@ -292,6 +295,7 @@ async def update_pseudo( [Google] => User pseudo will be renamed """ + await ctx.defer() try: user = User(search_user(self.bot.admin_sdk(), member.name, member.id)) is_user_managed( @@ -329,6 +333,7 @@ async def update_pseudo( @commands.guild_only() @is_gsuite_admin async def update_signatures(self, ctx): + await ctx.defer() user_updated = 0 try: users = get_users(self.bot.admin_sdk()) @@ -382,6 +387,7 @@ async def urecovery( member: discord.Member = commands.parameter(description="Discord user"), backup_email: str = commands.parameter(description="User backup email"), ): + await ctx.defer() try: user = User(search_user(self.bot.admin_sdk(), member.name, member.id)) is_user_managed( @@ -409,6 +415,7 @@ async def rpassword( ctx, member: discord.Member = commands.parameter(description="Discord user"), ): + await ctx.defer() try: user = User(search_user(self.bot.admin_sdk(), member.name, member.id)) is_user_managed(