Coverage for cmds/ver.py: 100%

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

2ver.py 

3 

4includes ver 

5""" 

6 

7from version import version 

8import error 

9 

10async def ver(*args): 

11 """ 

12 ver 

13 

14 returns formated version and date of update 

15 """ 

16 

17 # fix args 

18 args = args[1:] 

19 

20 # check args 

21 if len(args) > 0: 

22 raise error.UnknownArgumentError 

23 

24 with open('date.txt', 'r', encoding="utf-8") as date: 

25 with open("data.txt", "r", encoding="utf-8") as data: 

26 output = '\n'.join([ 

27 f'Discord bot version: {version}', 

28 f'Last updated: {date.readline().strip()}', 

29 f'Database last updated: {data.readline().strip()}', 

30 ]) 

31 return f'```{output}```'