Skip to content

Instantly share code, notes, and snippets.

@fabiocerqueira
Created August 1, 2014 04:53
Show Gist options
  • Select an option

  • Save fabiocerqueira/1b5a14420a46098af7d0 to your computer and use it in GitHub Desktop.

Select an option

Save fabiocerqueira/1b5a14420a46098af7d0 to your computer and use it in GitHub Desktop.
from wabot import WabotApp, reply
app = WabotApp()
@app.handler('group_message', command='!info')
@app.handler('private_message', command='!info')
def info(message, params):
reply("I'm wabot. Your parameter is: %s" % str(params))
if __name__ == '__main__':
bot_phone = os.environ.get("BOT_PHONE", "")
password = os.environ.get("BOT_PASSWORD", "")
wa = app.run(bot_phone, password)
from wabot import WabotApp, reply
app = WabotApp()
@app.handler('private_message')
def echo(message):
reply(message.content)
if __name__ == '__main__':
bot_phone = os.environ.get("BOT_PHONE", "")
password = os.environ.get("BOT_PASSWORD", "")
wa = app.run(bot_phone, password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment