Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

اجرا نکردن get_message #18

Open
mahigamemaker opened this issue Apr 5, 2020 · 5 comments
Open

اجرا نکردن get_message #18

mahigamemaker opened this issue Apr 5, 2020 · 5 comments

Comments

@mahigamemaker
Copy link

. ارور زیر رو میده وقتی
get_message
رو اجرا میکنم.

Invalid URL '<Response [200]>': No schema supplied. Perhaps you meant http://<Response [200]>?
retry to connect after 10 seconds...

کد رو هم تغییر ندادم. به راحتی پیام ارسال میکنم ولی دریافت رو مشکل دارم!

from sys import path
path.append('..')
from client import Client

bot_token = 'atyJDqAzb0p-*******************J-W'

bot = Client(bot_token)

try:
messages = bot.get_messages()
for message in messages:
print("New message from {} \nType: {}\nBody: {}" .format(message['from'], message['type'], message['body']))

except Exception as e:
print(e.args[0])

@bsimjoo
Copy link

bsimjoo commented Jul 13, 2020

اگر تو پوشه ی
example
نیستید خط دوم رو پاک کنید
چطور پیام ارسال می کنی وقتی آی دی یوزر رو نمی تونی دریافت کنی؟

@khalili67
Copy link

خطای زیر رو موقع دریافت پیام ها میده کی میدونه علتش چی هست؟؟
Failed to parse: <Response [200]>

@sinamoh13
Copy link

سلام این کدی که شما دادید فقط به صورت دستی میتونیم ایدی شخص رو وارد کنیم. حالا راهی هست که ربات اول ایدی رو به دست بیاره و بعد به همون ایدی پیام مورد نظر رو بفرسته؟؟
ممنون از زحمات شما

@bsimjoo
Copy link

bsimjoo commented Feb 7, 2021

ربات نمی تونه آیدی کاربرانی که شروع رو نزدن و عضو نشدن رو پیدا کنه ولی می تونید آی دی تمام کسانی که شروع رو زدن رو تو بانک اطلاعاتی یا هر چی ذخیره کنید تا هرموقع خواستید پیام بدین بهشون

@bsimjoo
Copy link

bsimjoo commented Oct 2, 2022

به نظرم مشکل از خط ۴۴ باشه که مربوط هست به تابع get_message، مشکل اینه که response رو مستقیم فرستاده به تابع.

bot-python-sdk/client.py

Lines 41 to 46 in aa29653

try:
response = requests.get(url, stream=True)
if 'Content-Type' in response.headers:
client = sseclient.SSEClient(response)
print('connected successfully\n')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants