-
Notifications
You must be signed in to change notification settings - Fork 10
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
ChatSendMessage problem #1
Comments
you might need to add this before sending:
also try to get more info from response:
|
can you please share a simple code on how to read and send msg from bot? |
I agree to @erfanoabdi, there isn't any clear explanation & example codes. |
I want to make a bot with python. I can get the message from bot and read it but when I want to send a message with API I get <Response [400]>. I used the below code. Is there any problem with my code?
from flask import Flask,request,json
app = Flask(name)
from ChatSendMessage_pb2 import ChatSendMessageResponse, ChatSendMessage
import requests
token = 'my-token'
@app.route('/get_command',methods=['POST'])
def get_command():
data = ChatSendMessageResponse.FromString(request.data)
message = data.room_message.message
room_id = data.room_id
new_message = ChatSendMessage()
new_message.message = 'hi'
new_message.room_id = room_id
if name == 'main':
app.run(host='0.0.0.0', port=7370, threaded=True, debug=False)
The text was updated successfully, but these errors were encountered: