mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 11:22:42 -06:00
added sending effects
This commit is contained in:
parent
7b88754c01
commit
0049f11783
2 changed files with 13 additions and 1 deletions
13
demo.py
13
demo.py
|
@ -127,6 +127,7 @@ threading.Thread(target=input_thread, daemon=True).start()
|
||||||
print("Type 'help' for help")
|
print("Type 'help' for help")
|
||||||
|
|
||||||
current_participants = []
|
current_participants = []
|
||||||
|
current_effect = None
|
||||||
while True:
|
while True:
|
||||||
msg = im.receive()
|
msg = im.receive()
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
|
@ -140,10 +141,18 @@ while True:
|
||||||
print('quit (q): quit')
|
print('quit (q): quit')
|
||||||
#print('send (s) [recipient] [message]: send a message')
|
#print('send (s) [recipient] [message]: send a message')
|
||||||
print('filter (f) [recipient]: set the current chat')
|
print('filter (f) [recipient]: set the current chat')
|
||||||
|
print('effect (e): adds an iMessage effect to the next sent message')
|
||||||
print('note: recipient must start with tel: or mailto: and include the country code')
|
print('note: recipient must start with tel: or mailto: and include the country code')
|
||||||
print('\\: escape commands (will be removed from message)')
|
print('\\: escape commands (will be removed from message)')
|
||||||
elif msg == 'quit' or msg == 'q':
|
elif msg == 'quit' or msg == 'q':
|
||||||
break
|
break
|
||||||
|
elif msg.startswith("effect ") or msg.startswith("e "):
|
||||||
|
msg = msg.split(" ")
|
||||||
|
if len(msg) < 2 or msg[1] == "":
|
||||||
|
print("effect [effect namespace]")
|
||||||
|
else:
|
||||||
|
print(f"next message will be sent with [{msg[1]}]")
|
||||||
|
current_effect = msg[1]
|
||||||
elif msg.startswith('filter ') or msg.startswith('f '):
|
elif msg.startswith('filter ') or msg.startswith('f '):
|
||||||
# Set the curernt chat
|
# Set the curernt chat
|
||||||
msg = msg.split(' ')
|
msg = msg.split(' ')
|
||||||
|
@ -158,8 +167,10 @@ while True:
|
||||||
im.send(imessage.iMessage(
|
im.send(imessage.iMessage(
|
||||||
text=msg,
|
text=msg,
|
||||||
participants=current_participants,
|
participants=current_participants,
|
||||||
sender=user.handles[0]
|
sender=user.handles[0],
|
||||||
|
effect=current_effect
|
||||||
))
|
))
|
||||||
|
current_effect = None
|
||||||
else:
|
else:
|
||||||
print('No chat selected, use help for help')
|
print('No chat selected, use help for help')
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,7 @@ class iMessage:
|
||||||
"pv": 0,
|
"pv": 0,
|
||||||
"gv": "8",
|
"gv": "8",
|
||||||
"v": "1",
|
"v": "1",
|
||||||
|
"iid": self.effect
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove keys that are None
|
# Remove keys that are None
|
||||||
|
|
Loading…
Reference in a new issue