Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # pythonexample.py
- import znc
- from twilio.rest import TwilioRestClient
- class account(object): pass
- account.sid = '<account sid>'
- account.auth = '<auth token>'
- client = TwilioRestClient(account.sid, account.auth)
- class pythonexample(znc.Module):
- description = "Example python3 module for ZNC"
- def OnChanMsg(self, nick, channel, message):
- if '<your nick>' in message.s.lower():
- client.messages.create(
- to="<your cell number>",
- from_="<twilio outbound number>",
- body="{0} said {1} on {2}".format(nick.GetNick(), message.s, channel.GetName())
- )
- return znc.CONTINUE
Advertisement
Add Comment
Please, Sign In to add comment