Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import fbchat
- from fbchat import Client
- from getpass import getpass
- username = "youremail@mail.com"
- client = fbchat.Client(username,getpass())
- no_of_friends = int(input("Number of friends: "))
- for i in range(no_of_friends):
- name = str(input("Name: "))
- friends = client.SearchForUsers(name)
- friend = friends[0]
- msg = str(input("Message: "))
- sent = client.send(fbchat.models.Message(msg),friend.uid)
- if sent:
- print("Message Sent!")
Add Comment
Please, Sign In to add comment