Fix type errors in all examples

This commit is contained in:
Rapptz
2025-08-16 05:21:19 -04:00
parent 7e2ca02fd1
commit 4f539b710f
26 changed files with 124 additions and 16 deletions

View File

@@ -18,6 +18,9 @@ bot = commands.Bot(command_prefix='?', description=description, intents=intents)
@bot.event
async def on_ready():
# Tell the type checker that User is filled up at this point
assert bot.user is not None
print(f'Logged in as {bot.user} (ID: {bot.user.id})')
print('------')
@@ -57,7 +60,11 @@ async def repeat(ctx, times: int, content='repeating...'):
@bot.command()
async def joined(ctx, member: discord.Member):
"""Says when a member joined."""
await ctx.send(f'{member.name} joined {discord.utils.format_dt(member.joined_at)}')
# Joined at can be None in very bizarre cases so just handle that as well
if member.joined_at is None:
await ctx.send(f'{member} has no join date.')
else:
await ctx.send(f'{member} joined {discord.utils.format_dt(member.joined_at)}')
@bot.group()