Hello,
i've started recently working with Python and i want to learn to send automatic messages with fbchat.
I cand send a text message, i can send an Emoji, but the problem is when i try sending a picture from my PC, it doesn't work.
The image is located in "D:/downloads" and the name of the picture is "1623622_833937009956843_569272768_n". Can you please help me ?
Job "mesaj_fb (trigger: interval[0:01:00], next run at: 2019-12-30 20:57:46 EET)" raised an exception
Traceback (most recent call last):
File "C:\Users......\base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "C:/Users/..../fb chat.py", line 17, in mesaj_fb
client.sendLocalImage(id,message='<message text>',image='1623622_833937009956843_569272768_n')
TypeError: sendLocalImage() got an unexpected keyword argument 'image'
Process finished with exit code -1
i've started recently working with Python and i want to learn to send automatic messages with fbchat.
I cand send a text message, i can send an Emoji, but the problem is when i try sending a picture from my PC, it doesn't work.
The image is located in "D:/downloads" and the name of the picture is "1623622_833937009956843_569272768_n". Can you please help me ?
import fbchat from fbchat import Client from fbchat.models import * import time from datetime import datetime from apscheduler.schedulers.blocking import BlockingScheduler path = 'D:\Downloads' def mesaj_fb(): client = fbchat.Client("username", "password") friend = client.searchForUsers("friend's name") id = friend[0].uid client.sendMessage('Tick! La semnalul urmator va fi ora: %s' % datetime.now(), id) client.send(Message(emoji_size=EmojiSize.SMALL), id) client.sendLocalImage(id,message='<message text>',image='1623622_833937009956843_569272768_n') sched = BlockingScheduler() sched.add_job(mesaj_fb, 'interval', minutes=1) sched.start()The log looks like this:
Job "mesaj_fb (trigger: interval[0:01:00], next run at: 2019-12-30 20:57:46 EET)" raised an exception
Traceback (most recent call last):
File "C:\Users......\base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "C:/Users/..../fb chat.py", line 17, in mesaj_fb
client.sendLocalImage(id,message='<message text>',image='1623622_833937009956843_569272768_n')
TypeError: sendLocalImage() got an unexpected keyword argument 'image'
Process finished with exit code -1