@@ -279,9 +279,21 @@ async def verify_user(ctx: commands.Context):
279
279
await ctx .reply ("This command has been removed, please use /verify instead." )
280
280
return
281
281
282
+ if ctx .interaction .is_expired ():
283
+ await ctx .reply (
284
+ "Your command expired due to some unknown error, please try again."
285
+ )
286
+ return
287
+
288
+ # defer because sometimes the command can take too long if the database connection
289
+ # is slow.
290
+ # it is important that is is ephemeral. It has a secret link that only the
291
+ # invoker must see.
292
+ await ctx .defer (ephemeral = True )
282
293
author = ctx .message .author
283
294
if await is_verified (author .id ):
284
295
# user has already previously verified
296
+ await ctx .interaction .followup .send (f"You are CAS-verified!" , ephemeral = True )
285
297
await post_verification (ctx , author )
286
298
return
287
299
@@ -298,9 +310,8 @@ async def verify_user(ctx: commands.Context):
298
310
expire_time = time .time () + VERIFY_TIMEOUT_SECONDS
299
311
token_to_id [token ] = (author .id , expire_time )
300
312
301
- # it is important that is is ephemeral. It has a secret link that only the
302
- # invoker must see.
303
- await ctx .send (
313
+ # use followup and not ctx reply/send because this message HAS to be ephemeral
314
+ await ctx .interaction .followup .send (
304
315
f"[This](<{ BASE_URL } /cas?token={ token } >) is your verification link, click "
305
316
"it to login and verify yourself.\n "
306
317
"IMPORTANT NOTE: Above link is secret, do not share with anyone! "
0 commit comments