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

10 statements  

1""" 

2profile.py 

3 

4includes profile() 

5""" 

6 

7import error 

8 

9async def profile(message, *args): 

10 """ 

11 profile() 

12 

13 Profile a user. 

14 """ 

15 

16 # check args 

17 if args: 

18 raise error.UnknownArgumentError 

19 

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}```" 

29 

30async def avatar(message, *args): 

31 """ 

32 avatar() 

33 

34 Get a user's avatar. 

35 """ 

36 

37 # check args 

38 if args: 

39 raise error.UnknownArgumentError 

40 

41 # get avatar 

42 return f"{message.author.avatar_url}"