What is my purpose?

This commit is contained in:
Felipe M 2020-04-22 23:58:06 +02:00
commit 89db0bb24d
Signed by: fmartingr
GPG key ID: 716BC147715E716F
29 changed files with 1607 additions and 0 deletions

View file

View file

@ -0,0 +1,17 @@
from datetime import datetime
from butterrobot.plugins import Plugin
from butterrobot.objects import Message
class PingPlugin(Plugin):
id = "contrib/dev/ping"
@classmethod
async def on_message(cls, message):
if message.text == "!ping":
delta = datetime.now() - message.date
delta_ms = delta.seconds * 1000 + delta.microseconds / 1000
return Message(
chat=message.chat, reply_to=message.id, text=f"pong! ({delta_ms}ms)",
)

View file

@ -0,0 +1,11 @@
from butterrobot.plugins import Plugin
from butterrobot.objects import Message
class LoquitoPlugin(Plugin):
id = "contrib/fun/loquito"
@classmethod
async def on_message(cls, message):
if "lo quito" in message.text.lower():
return Message(chat=message.chat, reply_to=message.id, text="Loquito tu.",)