Coverage for cmds/emote.py: 33%

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

9 statements  

1""" 

2emote.py 

3 

4contains emote() 

5""" 

6 

7import client 

8import error 

9 

10async def emote(*args): 

11 """ 

12 emote() 

13 

14 returns the emote 

15 """ 

16 

17 # fix args 

18 args = args[1:] 

19 

20 # check args 

21 if len(args) == 0: 

22 raise error.ArgumentRequiredError 

23 

24 if len(args) > 1: 

25 raise error.UnknownArgumentError 

26 

27 # return output 

28 return [ 

29 inner for outer in [ 

30 guild.emojis for guild in client.client.guilds 

31 ] for inner in outer if inner.name == args[0] 

32 ][0]