Merge branch 'master' of https://github.com/L0rd0fB0red0m/chat-bot
This commit is contained in:
commit
6a907fb4aa
20
main.py
20
main.py
@ -349,17 +349,15 @@ class ChatBot():
|
|||||||
"math" : "mathmemes"
|
"math" : "mathmemes"
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(params) == 0:
|
number = 1
|
||||||
number = 1
|
params_sorted = self.match_reddit_params(params)
|
||||||
else:
|
if params_sorted != None:
|
||||||
params_sorted = self.match_reddit_params(params)
|
if len(params_sorted) >= 1:
|
||||||
if params_sorted != None:
|
number = params_sorted[0]
|
||||||
if len(params_sorted) >= 1:
|
if len(params_sorted) >= 2:
|
||||||
number = params_sorted[0]
|
subreddit_name = params_sorted[1]
|
||||||
if len(params_sorted) >= 2:
|
if len(params) > 2:
|
||||||
subreddit_name = params_sorted[1]
|
self.telegram.send_message("Memes takes 2 parameters: the number of memes, and their topic.")
|
||||||
if len(params) > 2:
|
|
||||||
self.telegram.send_message("Memes takes 2 parameters: the number of memes, and their topic.")
|
|
||||||
|
|
||||||
urls = reddit.get_random_rising(subreddit_name, number, "photo")
|
urls = reddit.get_random_rising(subreddit_name, number, "photo")
|
||||||
for u in urls:
|
for u in urls:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user