Closed daktak closed 4 months ago
virtualenv . -p /usr/bin/python3 source ./bin/activate pip -r requirements.txt python main.py
After setting up a provider and a channel, I used below to create a short-lived access token (can you do a long lived one?) https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token
But i'm unsure what value ROOM = should be, and I get the below error
linebot.exceptions.LineBotApiError: LineBotApiError: status_code=403, request_id=7e6fef71-bc31-4ba7-8fbc-a5a59dbec1d7, error_response={"details": [], "message": "Forbidden"}, headers={'Server': 'openresty', 'Content-Type': 'application/json', 'x-line-request-id': '7e6fef71-bc31-4ba7-8fbc-a5a59dbec1d7', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'DENY', 'Expires': 'Sun, 11 Apr 2021 03:32:06 GMT', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Pragma': 'no-cache', 'Date': 'Sun, 11 Apr 2021 03:32:06 GMT', 'Connection': 'close'}
Ok, creating a messaging api I get the following errror
linebot.exceptions.LineBotApiError: LineBotApiError: status_code=400, request_id=a6a4517b-8f6d-47b4-ae62-4553e472b39c, error_response={"details": [], "message": "The property, 'to', in the request body is invalid (line: -, column: -)"}, headers={'Server': 'openresty', 'Content-Type': 'application/json', 'x-line-request-id': 'a6a4517b-8f6d-47b4-ae62-4553e472b39c', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'DENY', 'Content-Length': '85', 'Expires': 'Sun, 11 Apr 2021 03:59:26 GMT', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Pragma': 'no-cache', 'Date': 'Sun, 11 Apr 2021 03:59:26 GMT', 'Connection': 'close'}
OK, I will put the documents as soon as possible.
Ok, ROOM value should be populated with the reply string when adding the bot to group that has not been entered in the config.ini yet.
Ok, now if I send a message from Matrix, it spams with a history of all messages from Matrix
Also i think matrix room must not be encrypted? is below needed in matrix/poll.py under message_callback if room.room_id != config_instance["Matrix"]["ROOM"]: return
Fyi bridge server and port must be exposed to the web for webhook. Also url appears to need /callback appended in line API settings
OK, I will put the documents as soon as possible.
README has been updated.
Ok, now if I send a message from Matrix, it spams with a history of all messages from Matrix
This is the bug I was finding, but I need someone who knows Matrix API to resolve the problem.
Under the wiki, please mention the user/pass for Matrix should not be the user you will use to chat. +The ID for you to login the network of Matrix. Set up a new user to act as your bridge puppet, as the bridge will not relay messages sent by this user. Add this user to the groups that are bridged to a line room.
Also worth mentioning the Line chat bot must be added to the line room. Matrix group should be unencrypted
OK, I will update them asap.
Are you able to update install/running instructions for javascript ? how to convert config.ini to js config .env? How to generate the matrix token?
just found .env.sample
How to generate the matrix token?
The method exists in (Merged)
But https://t2bot.io/docs/access_tokens/ can help you to generate one from Element.dev
branch only currently.
curl -XPOST -d '{"type":"m.login.password", "user":"yourmatrixuser", "password":"yourpass!"}' "https://yourmatrixhost/_matrix/client/r0/login"
Above is a nice simple way to get the token, perhaps add to the documentation?
Above is a nice simple way to get the token, perhaps add to the documentation?
That's cool! But there is a new feature can help you get the AccessToken more friendly since 8fff486c8cf03e21ad410ce81b9b45c624bf75ca.
npm run get-matrix-access
starting to update the wiki https://github.com/daktak/matrix-line-bridge/wiki/1_Create_Line_Bot
The documentation is working in processing. https://github.com/web-tech-tw/arona/pull/20
Completed. https://github.com/web-tech-tw/arona/pull/20
Are you able to post a README on how to set up a personal LINE API key and this bridge?