mirror of
https://codeberg.org/sch/BukuBot
synced 2024-12-22 18:05:24 +01:00
Check whether second parameter is an integer (Thank you mirux).
This commit is contained in:
parent
c1a5d8d5a6
commit
b1891f33ac
1 changed files with 28 additions and 24 deletions
|
@ -125,6 +125,8 @@ class Chat:
|
|||
case _ if (message_lowercase.startswith('tag +') or
|
||||
message_lowercase.startswith('tag -')):
|
||||
message_lowercase_split = message_lowercase[4:].split(' ')
|
||||
try:
|
||||
int(message_lowercase_split[1])
|
||||
if len(message_lowercase_split) > 2:
|
||||
arg = message_lowercase_split[0]
|
||||
val = message_lowercase_split[1]
|
||||
|
@ -150,6 +152,8 @@ class Chat:
|
|||
'(1) + or - sign; '
|
||||
'(2) <ID> or <URL>; '
|
||||
'(3) <TAGS>.')
|
||||
except:
|
||||
message_body = 'Second parameter must be an ID number.'
|
||||
case _ if message_lowercase.startswith('tag'):
|
||||
tag = message_lowercase[4:]
|
||||
results = bookmarks_db.search_by_tag(tag)
|
||||
|
|
Loading…
Reference in a new issue