What is my purpose?
This commit is contained in:
commit
89db0bb24d
29 changed files with 1607 additions and 0 deletions
0
butterrobot_plugins_contrib/__init__.py
Normal file
0
butterrobot_plugins_contrib/__init__.py
Normal file
17
butterrobot_plugins_contrib/dev.py
Normal file
17
butterrobot_plugins_contrib/dev.py
Normal 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)",
|
||||
)
|
11
butterrobot_plugins_contrib/fun.py
Normal file
11
butterrobot_plugins_contrib/fun.py
Normal 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.",)
|
Loading…
Add table
Add a link
Reference in a new issue