Created
July 17, 2014 01:02
-
-
Save zoni/a196c480d3fb6acc547c to your computer and use it in GitHub Desktop.
self.send() example for Err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Core] | |
Name = SendHello | |
Module = sendhello | |
[Python] | |
Version = 2+ | |
[Documentation] | |
Description = Demonstrating self.send() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from errbot import BotPlugin, botcmd | |
class SendHello(BotPlugin): | |
"""Demonstrating self.send()""" | |
@botcmd | |
def sendhello(self, msg, args): | |
"""Send hello back""" | |
type_ = msg.getType() | |
from_ = msg.getFrom() | |
yield ">> Hi there! You sent me a {} message from {}".format(type_, from_) | |
yield ">> I will now send you a message back on that ID!" | |
self.send(user=from_, message_type=type_, text="Hello!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment