Closed BenTheHokie closed 12 years ago
from ttapi import Bot
bot = Bot(AUTH, USERID, ROOMID)
# Define callback
def pmmed(data):
sender = data['senderid']
text = data['text']
print 'You received %s from %s' % (text, sender)
# Send a message to the sender !
bot.pm('Hey !', sender)
# Bind listener
bot.on('pmmed', pmmed)
# Start the bot
bot.start()
Does it help ?
Yes thanks a bunch
Could someone whip up a quick example for replying to PMs in Python (something like the chat bot example except for PMming)? I'm having trouble trying to understand how to use it.
Thanks in advance.