bot: sample use to copy-paste
This commit is contained in:
@@ -103,7 +103,8 @@ async def on_message(message):
|
|||||||
f"You can generate a meme with the syntax\n"
|
f"You can generate a meme with the syntax\n"
|
||||||
f"```\n"
|
f"```\n"
|
||||||
f"[template] \"text 1\" \"text 2\" ...\n"
|
f"[template] \"text 1\" \"text 2\" ...\n"
|
||||||
f"```"
|
f"```\n"
|
||||||
|
f"I also work with DM to keep your server clean of spam.\n"
|
||||||
f"You can find a more detailed help and a list of templates at:\n"
|
f"You can find a more detailed help and a list of templates at:\n"
|
||||||
f"<https://github.com/klemek/meme-otron/tree/master/discord>")
|
f"<https://github.com/klemek/meme-otron/tree/master/discord>")
|
||||||
return
|
return
|
||||||
@@ -138,6 +139,10 @@ async def on_message(message):
|
|||||||
response += f"\n- Aliases: `{'`, `'.join(meme.aliases)}`"
|
response += f"\n- Aliases: `{'`, `'.join(meme.aliases)}`"
|
||||||
if meme.info is not None:
|
if meme.info is not None:
|
||||||
response += f"\n- More info: <{meme.info}>"
|
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)]) + \
|
||||||
|
"\"```"
|
||||||
elif not direct:
|
elif not direct:
|
||||||
response = f"A meme by {message.author.mention}:"
|
response = f"A meme by {message.author.mention}:"
|
||||||
if mid not in SENT:
|
if mid not in SENT:
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ def load_item(i, item):
|
|||||||
text.style_ref -= 1
|
text.style_ref -= 1
|
||||||
text.update(meme.texts[text.style_ref])
|
text.update(meme.texts[text.style_ref])
|
||||||
meme.texts += [text]
|
meme.texts += [text]
|
||||||
|
meme.texts_len = c - 1
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
logger.warning(f"Item '{item_id}'({i + 1}) / Text {j + 1}: {e}")
|
logger.warning(f"Item '{item_id}'({i + 1}) / Text {j + 1}: {e}")
|
||||||
for text in meme.texts:
|
for text in meme.texts:
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class Meme:
|
|||||||
self.template = None
|
self.template = None
|
||||||
self.text_base = Text()
|
self.text_base = Text()
|
||||||
self.texts = None
|
self.texts = None
|
||||||
|
self.texts_len = 0
|
||||||
|
|
||||||
def clone(self):
|
def clone(self):
|
||||||
return copy.deepcopy(self)
|
return copy.deepcopy(self)
|
||||||
|
|||||||
Reference in New Issue
Block a user