Between of VCNC for Python
Project description
How to be loved? this is the answer for your question.
How to use
Date with somebody
Install Between
Write a fun bot
Be loved by your lover
Installation
Simple.
$ pip install betweeen
Example
Simple commands:
import betweeen
client = betweeen.Client("YOUR_ID", "YOUR_PASSWORD")
client.send("Carpe diem!")
client.send_sticker()
client.send_image("./test.jpg")
import betweeen
def on_message(ws, message):
print message
def on_open(ws):
ws.send("Hello World!")
bot = betweeen.Bot("YOUR_ID", "YOUR_PASSWORD", on_open=on_open, on_message=on_message)
bot.run_forever()
import between
account = "YOUR_ID"
password = "YOUR_PASSWORD"
client = between.Client(account, password)
me = client.me.account_id
lover = client.lover.account_id
def on_message(ws, message):
print message
if message.has_key('p'):
if message['p'] == 'events':
for event in message['m']['events']:
if event['action'] == 'EA_ADD':
msg = event['messageEvent']['message']
if msg['from'] != me:
if msg.has_key('attachments'):
attachment = msg['attachments'][0]
if attachment.has_key('reference'):
ws.send_image(image_id=attachment['reference'])
elif attachment.has_key('sticker'):
ws.send_sticker(attachment['sticker']['sticker_id'])
elif msg.has_key('content'):
ws.send(msg['content'])
bot = between.Bot(client=client, on_message=on_message)
bot.run_forever()
To do
[x] Login, Authentication
[x] Send a message
[x] Send a sticker
[x] Send an image
[x] Get recent messages
[x] Message long polling
[ ] Get uploaded image lists
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
between-0.2.1.tar.gz
(20.1 kB
view hashes)