fix help function

This commit is contained in:
2021-06-15 00:43:38 +02:00
parent 5facd8b5a5
commit f6cbb87967
5 changed files with 17 additions and 10 deletions

View File

@@ -1,20 +1,19 @@
keywords = ['gifbot']
keywords = ['roll']
def help(keyword=''):
"""Filter for general help or specific keyword help."""
if not keyword:
file = open('help/help.md')
contents = file.read()
return (contents)
return format((contents))
if keyword[0]:
keyword = str.lower(keyword)
if keyword in keywords:
document = 'help/help_' + keyword + '.md'
print(document)
file = open(document, 'r')
contents = file.read()
return (contents)
return format((contents))
else:
file = open('help/help.md')
contents = file.read()
return (contents)
return format((contents))