Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff337ecea7 | |||
| cd329a9001 | |||
| a7a22861f6 | |||
| 8855479ecd | |||
| c42f6452fd | |||
| b3165f7acc |
@@ -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}:"
|
||||
|
||||
@@ -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
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user