31 lines
706 B
Python
31 lines
706 B
Python
import re
|
|
|
|
def pluginStart():
|
|
print(f"Starting '{__name__}'")
|
|
|
|
def genericHooks():
|
|
print(f"Starting '{__name__}'")
|
|
funcList = []
|
|
print(f"Registering hooks {funcList}")
|
|
return [__name__,funcList]
|
|
|
|
def messageHooks():
|
|
funcList = ["onMessage"]
|
|
print(f"Registering hooks {funcList}")
|
|
return [__name__,funcList]
|
|
|
|
def mentionHooks():
|
|
funcList = ["onMention"]
|
|
return [__name__,funcList]
|
|
|
|
def exampleFunc():
|
|
# Do code
|
|
pass
|
|
|
|
def onMessage(msg):
|
|
print(f"From: {msg['name']}\nMessage: {msg['message']}")
|
|
|
|
def onMention(msg):
|
|
mention = re.search(r"@.+? ", msg["message"]).group(0)
|
|
mention = mention.strip()
|
|
print(f"{mention.split('@')[1]} got mentioned") |