Skip to content

Commit 97c70bf

Browse files
committed
fix typing
1 parent 2214cbe commit 97c70bf

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ async def on_typing(self, channel, user, _):
12271227
thread = await self.threads.find(recipient=user)
12281228

12291229
if thread:
1230-
await thread.channel.trigger_typing()
1230+
await thread.channel.typing()
12311231
else:
12321232
if not self.config.get("mod_typing"):
12331233
return
@@ -1237,7 +1237,7 @@ async def on_typing(self, channel, user, _):
12371237
for user in thread.recipients:
12381238
if await self.is_blocked(user):
12391239
continue
1240-
await user.trigger_typing()
1240+
await user.typing()
12411241

12421242
async def handle_reaction_events(self, payload):
12431243
user = self.get_user(payload.user_id)
@@ -1508,7 +1508,7 @@ async def on_error(self, event_method, *args, **kwargs):
15081508

15091509
async def on_command_error(self, context, exception):
15101510
if isinstance(exception, (commands.BadArgument, commands.BadUnionArgument)):
1511-
await context.trigger_typing()
1511+
await context.typing()
15121512
await context.send(embed=discord.Embed(color=self.error_color, description=str(exception)))
15131513
elif isinstance(exception, commands.CommandNotFound):
15141514
logger.warning("CommandNotFound: %s", exception)

cogs/modmail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ async def logs(self, ctx, *, user: User = None):
11581158
`user` may be a user ID, mention, or name.
11591159
"""
11601160

1161-
await ctx.trigger_typing()
1161+
await ctx.typing()
11621162

11631163
if not user:
11641164
thread = ctx.thread
@@ -1268,7 +1268,7 @@ async def logs_search(self, ctx, limit: Optional[int] = None, *, query):
12681268
Provide a `limit` to specify the maximum number of logs the bot should find.
12691269
"""
12701270

1271-
await ctx.trigger_typing()
1271+
await ctx.typing()
12721272

12731273
entries = await self.bot.api.search_by_text(query, limit)
12741274

core/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ def lottie_to_png(data):
11341134
logger.info("Sending a message to %s when DM disabled is set.", self.recipient)
11351135

11361136
try:
1137-
await destination.trigger_typing()
1137+
await destination.typing()
11381138
except discord.NotFound:
11391139
logger.warning("Channel not found.")
11401140
raise

core/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ def format_description(i, names):
397397
def trigger_typing(func):
398398
@functools.wraps(func)
399399
async def wrapper(self, ctx: commands.Context, *args, **kwargs):
400-
await ctx.trigger_typing()
401-
return await func(self, ctx, *args, **kwargs)
400+
async with ctx.typing():
401+
return await func(self, ctx, *args, **kwargs)
402402

403403
return wrapper
404404

0 commit comments

Comments
 (0)