Skip to content
Snippets Groups Projects
Commit e8ca0112 authored by overflow's avatar overflow
Browse files

added room to feature parameters

parent 91c5cfd7
No related branches found
No related tags found
No related merge requests found
from matrix_client.client import MatrixClient
class FeatureExamples:
@staticmethod
def echo(sender, message):
def echo(sender, message, room):
"""
Print sender and message.
......@@ -11,11 +11,13 @@ class FeatureExamples:
String.
:param message:
String.
:param room:
Matrix room
"""
print(sender, message)
room.sendText(message)
@staticmethod
def caps(sender, message):
def caps(sender, message, room):
"""
Message to upper case.
......@@ -23,5 +25,7 @@ class FeatureExamples:
String.
:param message:
String.
:param room:
Matrix room.
"""
print(message.upper())
......@@ -96,4 +96,4 @@ class FeatureHandler:
for command in self.__commands:
if msg.startswith(command):
# call corresponding feature
self.__features[command](sender=sender, message=msg)
self.__features[command](sender=sender, message=msg, room=self.__room)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment