From 37b24b44758ea4f50f964429d60a4acfe7583cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Wikle=20DUBARD?= <loic97429@gmail.com> Date: Tue, 20 Aug 2019 14:03:34 +0200 Subject: [PATCH] change title of thread possible --- bot.py | 6 +++++- useless/shitpostbot5k.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 15b14f2..9287ddc 100755 --- a/bot.py +++ b/bot.py @@ -56,10 +56,11 @@ class Bot(Client): '!kohlanta <nom>\n' + \ '!rateau \n' + \ '!maps <nom_du_lieu> <destination(facultatif)> ... not yet fully fonctionnal\n' + \ - '!memes <image_name_or_url> ; <texte1> ; <texte2(facultatif)> ... not yet implemented\n' + \ + '!memes <image_name_or_url> ; <texte1> ; <texte2(facultatif)>\n' + \ '!ping \n' + \ '!translate <phrase> ; <lang_source> ; <lang_dest>\n' + \ '!shitpostbot5000 [status|on|off|random <keyword(facultatif)>] ... ne pas utiliser PLEASE\n' + \ + '!title <newtitle>\n'\ '!about -> vas-y test-moi !\n' return help_text elif '!translate' in texte: @@ -80,6 +81,9 @@ class Bot(Client): elif texte == '!haddock': return useless.haddock() + elif '!title ' in texte: + texte = texte.replace("!title ", '') + client.changeThreadTitle(texte, thread_id=thread_id, thread_type=thread_type) # renomer qqn elif '!rename' in texte: texte = texte.replace('!rename ', '').split(';') diff --git a/useless/shitpostbot5k.py b/useless/shitpostbot5k.py index b271167..99d6e34 100755 --- a/useless/shitpostbot5k.py +++ b/useless/shitpostbot5k.py @@ -60,7 +60,7 @@ class Shitpostbot5000(object): @classmethod def random(self, hashtag=''): if hashtag.strip() == '': - hashtag = random.choice(['shitpostmeme', 'shitpost', 'shitposts', 'memes']) + hashtag = random.choice(['shitpostmeme', 'shitpost', 'shitposts', 'memes', 'dank', 'dankmemes', 'dankdank', 'dankmemesdaily', 'dankest', 'dankymemes', 'danks', 'dankhumor', 'dankmemez', 'dankmems', 'dankmeme']) elif hashtag.strip() == 'climbing': hashtag = random.choice(['climbingmemes', 'rockclimbingmemes', 'climbingmemesaredank', 'climbingmemesofinstagram']) self.ctx = ssl.create_default_context() -- GitLab