6 Commits

Author SHA1 Message Date
klemek ff337ecea7 1.1 fixed arguments parsing 2020-04-26 23:38:01 +02:00
klemek cd329a9001 new dev version 2020-04-26 23:30:33 +02:00
klemek a7a22861f6 v1.1 2020-04-26 23:29:09 +02:00
klemek 8855479ecd updated docs 2020-04-26 23:28:48 +02:00
klemek c42f6452fd sample message fix 2020-04-26 23:28:30 +02:00
klemek b3165f7acc New branch 2020-04-26 23:10:46 +02:00
3 changed files with 12 additions and 3 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ from meme_otron import meme_db as db
from meme_otron import utils
from meme_otron import meme_otron
VERSION = "1.0"
VERSION = "1.1"
DOC_URL = "https://github.com/klemek/meme-otron/tree/master/docs/README.md"
t0 = datetime.now()
logging.basicConfig(format="[%(asctime)s][%(levelname)s][%(module)s] %(message)s", level=logging.INFO)
@@ -148,7 +148,7 @@ async def on_message(message):
response += f"\n- More info: <{meme.info}>"
response += f"\n- Use:" \
f"\n```{meme.id} \"" + \
"\" \"".join([f"text {i}" for i in range(meme.texts_len)]) + \
"\" \"".join([f"text {i + 1}" for i in range(meme.texts_len)]) + \
"\"```"
elif not direct:
response = f"A meme by {message.author.mention}:"
+2
View File
@@ -23,6 +23,8 @@ Tag the bot and use the above syntax to get started. In addition, you can use th
* Use `list` to get a list of all meme ids
* Use `delete` to delete the last message sent by the bot (directed to you)
To get the template info, just send the meme id without texts.
Enjoy the full experience of this bot by using direct messages to keep your server free of spam.
## CLI features
+8 -1
View File
@@ -120,7 +120,14 @@ def parse_arguments(s):
:rtype: list of str
:return:
"""
return [[g for g in m if len(g) > 0][0] for m in args_regex.findall(s)]
return [get_found_match(m) for m in args_regex.findall(s)]
def get_found_match(m):
f = [g for g in m if len(g) > 0]
if len(f) > 0:
return f[0]
return ""
def find_nearest(word, wlist, threshold=5):