summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authormdway <romangraef@gmail.com>2017-10-01 16:58:53 +0200
committermdway <romangraef@gmail.com>2017-10-01 16:58:53 +0200
commitb5fcfecbdc1e4d236af04df7b60f2822b6a5d06a (patch)
treebd130f300ae897bc0cf2b82ae0e54c591b6df654 /src/modules
downloadPostfix-Bot-b5fcfecbdc1e4d236af04df7b60f2822b6a5d06a.tar.gz
Postfix-Bot-b5fcfecbdc1e4d236af04df7b60f2822b6a5d06a.tar.bz2
Postfix-Bot-b5fcfecbdc1e4d236af04df7b60f2822b6a5d06a.zip
Initial commit
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/echo.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/echo.py b/src/modules/echo.py
new file mode 100644
index 0000000..9510442
--- /dev/null
+++ b/src/modules/echo.py
@@ -0,0 +1,18 @@
+import asyncio
+
+import main
+
+client = None
+
+
+@main.description("aka cat")
+@main.name("echo")
+@asyncio.coroutine
+def echo(args, author, channel, message):
+ yield from client.send_message(channel, content=author.mention + ': ' + args[0])
+
+
+def setup(default_cmds, cclient):
+ global client
+ default_cmds += [echo]
+ client = cclient