diff --git a/bot.py b/bot.py index f8c5e70bdded8dd9d9699540a769694ae96f374a..15b14f213f6df87b5c6816235ead8639227e71ae 100755 --- a/bot.py +++ b/bot.py @@ -59,7 +59,7 @@ class Bot(Client): '!memes <image_name_or_url> ; <texte1> ; <texte2(facultatif)> ... not yet implemented\n' + \ '!ping \n' + \ '!translate <phrase> ; <lang_source> ; <lang_dest>\n' + \ - '!shitpostbot5000 [status|on|off|random|timer] ... ne pas utiliser PLEASE\n' + \ + '!shitpostbot5000 [status|on|off|random <keyword(facultatif)>] ... ne pas utiliser PLEASE\n' + \ '!about -> vas-y test-moi !\n' return help_text elif '!translate' in texte: @@ -105,9 +105,9 @@ class Bot(Client): elif '!shitpostbot5000 random' in texte: texte = texte.replace('!shitpostbot5000 random', '') if texte == '': - return useless.Shitpostbot5000.random() + self.sendLocalImage(useless.Shitpostbot5000.random(), thread_id=thread_id, thread_type=thread_type) else: - return useless.Shitpostbot5000.random(texte) + self.sendLocalImage(useless.Shitpostbot5000.random(texte), thread_id=thread_id, thread_type=thread_type) # pour rigoler elif '!memes templates' in texte: diff --git a/useless/shitpostbot5k.py b/useless/shitpostbot5k.py index 2ebe45da9b3e1a2771af9acc451b6e5adc6996ec..7195e221ac36be5d96f3f3d978c85aa51beb9fa8 100755 --- a/useless/shitpostbot5k.py +++ b/useless/shitpostbot5k.py @@ -62,7 +62,8 @@ class Shitpostbot5000(object): self.ctx = ssl.create_default_context() self.ctx.check_hostname = False self.ctx.verify_mode = ssl.CERT_NONE - return random.choice(self.getlinks(hashtag, 'https://www.instagram.com/explore/tags/' + hashtag + '/')) + urllib.request.urlretrieve(random.choice(self.getlinks(hashtag, 'https://www.instagram.com/explore/tags/' + hashtag + '/')), 'insta_random.jpg') + return 'insta_random.jpg' if __name__ == "__main__":