Coverage for cmds/profile.py: 30%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2profile.py
4includes profile()
5"""
7import error
9async def profile(message, *args):
10 """
11 profile()
13 Profile a user.
14 """
16 # check args
17 if args:
18 raise error.UnknownArgumentError
20 # get profile
21 string = '\n'.join([
22 f"Name: {message.author}",
23 f"ID: {message.author.id}",
24 f"Created at: {message.author.created_at}",
25 f"Bot: {message.author.bot}",
26 f"System: {message.author.system}"
27 ])
28 return f"```{string}```"
30async def avatar(message, *args):
31 """
32 avatar()
34 Get a user's avatar.
35 """
37 # check args
38 if args:
39 raise error.UnknownArgumentError
41 # get avatar
42 return f"{message.author.avatar_url}"