sorunome / mx-puppet-twitter Goto Github PK
View Code? Open in Web Editor NEWA twitter matrix puppeting bridge
License: Apache License 2.0
A twitter matrix puppeting bridge
License: Apache License 2.0
Hello,
22:09:38 <alarig> help
22:09:38 <_twitterpuppet_bot> Available commands: link, unlink, relink, help, list, setmatrixtoken, adminme, listusers, listrooms, listgroups, settype, setispublic, setautoinvite, invite, groupinvite, unbridge, fixghosts, fixmute, resendbridgeinfo
Type help <command> to get more help on them.
22:09:45 <alarig> help link
22:09:45 <_twitterpuppet_bot> Command link not found!
22:09:55 <alarig> help list
22:09:55 <_twitterpuppet_bot> List all set links along with their information.
Usage: list
22:10:02 <alarig> list
22:10:02 <_twitterpuppet_bot> Links:
● 1: Twitter as alarig_ (alarig)
22:10:16 <alarig> listusers
22:10:16 <_twitterpuppet_bot> Feature not implemented!
22:10:21 <alarig> listrooms
22:10:21 <_twitterpuppet_bot> Feature not implemented!
22:10:25 <alarig> listgroups
22:10:25 <_twitterpuppet_bot> Feature not implemented!
22:10:31 <alarig> invite
22:10:31 <_twitterpuppet_bot> Couldn't send invite to the room. Perhaps you don't have permission to see it?
22:10:51 <alarig> fixghosts
22:10:51 <_twitterpuppet_bot> Room not resolvable
22:10:58 <alarig> fixmute
22:10:58 <_twitterpuppet_bot> Room not resolvable
I was trying to re-invite me to a PM that I leaved, and I don’t see how.
(node:11704) UnhandledPromiseRejectionWarning: Error: Forbidden.
at Request._callback (.................../mx-puppet-twitter/node_modules/twitter-webhooks/lib/helpers.js:27:33)
at Request.self.callback (................/mx-puppet-twitter/node_modules/request/request.js:185:22)
at Request.emit (events.js:196:13)
at Request.<anonymous> (................/mx-puppet-twitter/node_modules/request/request.js:1161:10)
at Request.emit (events.js:196:13)
at IncomingMessage.<anonymous> (................/mx-puppet-twitter/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:284:20)
at IncomingMessage.emit (events.js:201:15)
at endReadableNT (_stream_readable.js:1130:12)
at processTicksAndRejections (internal/process/task_queues.js:84:9)
(node:11704) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11704) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Can anyone please help with this? I really am unsure what is wrong here.
I think It is becasue of this issue, that the bot will not even register to my server.
Any suggestions on how I can debug this one?
Apr-6 05:41:01.653 [PuppetBridge] info: Application service started!
Apr-6 05:41:01.653 [PuppetBridge] info: Setting bridge user data...
Apr-6 05:41:04.435 [TwitterPuppet:Twitter] error: Failed to register new webhook Error: Non-200 response code during CRC GET request (i.e. 404, 500, etc).
at Request._callback (/opt/mx-puppet-twitter/node_modules/twitter-webhooks/lib/helpers.js:27:33)
at Request.self.callback (/opt/mx-puppet-twitter/node_modules/request/request.js:185:22)
at Request.emit (events.js:316:20)
at Request.<anonymous> (/opt/mx-puppet-twitter/node_modules/request/request.js:1161:10)
at Request.emit (events.js:316:20)
at IncomingMessage.<anonymous> (/opt/mx-puppet-twitter/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:422:28)
at IncomingMessage.emit (events.js:328:22)
at endReadableNT (_stream_readable.js:1201:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 214,
statusCode: 400,
body: { errors: [ [Object] ] }
}
Apr-6 05:41:04.436 [PuppetBridge] info: Activating users...
config.yaml
bridge:
port: 29322
domain: nova.chat
bindAddress: 0.0.0.0
homeserverUrl: https://asmux.nova.chat
loginSharedSecretMap:
nova.chat:
homeserverUrlMap:
nova.chat: https://asmux.nova.chat
namePatterns:
user: :name [:team? - :team,] Twitter
room: :name [:team? - :team,] Twitter
group: :name - Twitter
logging:
console: info
files:
- file: /data/debug.log
level: silly
disable:
- 'PresenceHandler'
- 'bot-sdk-Metrics'
presence:
enabled: false
database:
filename: /data/twitter.db
provisioning:
whitelist:
- "@testtwo:nova\\.chat"
sharedSecret:
apiPrefix: /_matrix/provision
twitter:
consumerKey: ""
consumerSecret: ""
accessToken: "-"
accessTokenSecret: ""
environment: "novadev"
server:
url: https://testtwo.novabridge.dev/twitter
host: 0.0.0.0
port: 4567
Attempting to get this bridge running on my Arch Linux server. I've managed to run npm install
(after installing the sqlite3
package) but I'm stuck from there. Wouldn't mind running this as a Docker container, looks like it's possible, but there's no information about what ports need mapped or how to generate the config.yaml
. Would love to take this for a spin and potentially contribute to the project if I can get it running!
node ./src
- I am not too familiar with how node operates but executing a directory seems strange? and aslo does not work.
Then the closed issue where you referenced the discord puppet turned this up:
npm run start -- -r [-c config.yaml] [-f discord-registration.yaml]
This actually works, and generates the registration config.
(square brackets being optional and default values so just delete them in case you don't want to specify anything new.)
Maybe update the readme?.
Not sure tho. As I said, I do not really know node so the first option might eventually work.
@_twitterpuppet_bot
link
@_twitterpuppet_bot
Status] 7: Twitter as <USERNAME> (<username>): disconnected!: failed to connect. TypeError: Cannot read property 'unsubscribe' of null
I'm not sure what I did incorrectly here. Any advice?
Logs from journalctl matrix-mx-puppet-twitter
:
[TwitterPuppet:Twitter] warn: Failed to subscribe to user, retrying... TypeError: Cannot read property 'subscribe' of null
at Twitter.<anonymous> (/opt/mx-puppet-twitter/build/twitter.js:92:55)
at Generator.next (<anonymous>)
at fulfilled (/opt/mx-puppet-twitter/build/twitter.js:5:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[TwitterPuppet:Twitter] error: Failed to start up puppet 8 TypeError: Cannot read property 'unsubscribe' of null
at Twitter.<anonymous> (/opt/mx-puppet-twitter/build/twitter.js:97:40)
at Generator.next (<anonymous>)
at fulfilled (/opt/mx-puppet-twitter/build/twitter.js:5:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I've set up everything as far as I can see, but I'm getting this error. (I set up a reverse proxy and pointed it to the internal host where the bridge is running, but I'm still getting this error.
Any tip about how can I debug it?
Thanks!
Jan-28 18:09:30.561 [Store] info: Starting DB Init
Jan-28 18:09:30.565 [Store] info: Filename present in config, using sqlite
Jan-28 18:09:30.566 [SQLite3] info: Opening database.db
Jan-28 18:09:30.570 [Store] info: Database schema version is 9, latest version is 9
(node:7454) UnhandledPromiseRejectionWarning: Error: Forbidden.
at Request.request [as _callback] (/opt/mx-puppet-twitter/node_modules/twitter-webhooks/lib/helpers.js:27:33)
at Request.self.callback (/opt/mx-puppet-twitter/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request.<anonymous> (/opt/mx-puppet-twitter/node_modules/request/request.js:1161:10)
at Request.emit (events.js:198:13)
at IncomingMessage.<anonymous> (/opt/mx-puppet-twitter/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:7454) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7454) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hello,
I managed to install this puppet and connect to it correctly via the bot (says connected!)
I double checked the keys and secrets, all seems to be alright but I can't recieve any message looks like, when my friends send messages I don't recieve them in matrix, same if I send them from twitter itself.
The service seems to be struggling to do some stuff, here's a part of the log that's outputed when I try to speak from twitter directly, it seems to react but fail to transmit the message (I can't copy the whole thing in ssh, I don't know how to get the log, not very linux savy)
log.txt
Messages fail to be bridged in either direction. not much in logs unfortunately.
Jan-15 17:25:34.159 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-15 17:25:34.162 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-15 17:25:34.183 [UserSync] �[32minfo�[39m: Fetching client for 1144425621340078081
Jan-15 17:25:34.188 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) POST http://synapse:8008/_matrix/client/r0/register
Jan-15 17:25:34.199 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-3) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-15 17:25:34.222 [ChannelSync] �[32minfo�[39m: Fetching mxid for roomId 1144425621340078081 and puppetId 1
Jan-15 17:25:34.229 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-15 17:25:34.236 [bot-sdk-MatrixLiteClient] �[31merror�[39m: (REQ-1) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Jan-15 17:25:34.237 [bot-sdk-Appservice] �[31merror�[39m: Error registering user: User ID is in use
Jan-15 17:25:34.252 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-15 17:25:34.266 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-2) PUT http://synapse:8008/_matrix/client/r0/rooms/!bZztJeWksThqaiKTkM%3Aeric.nova.chat/send/m.room.message/1579109134266__REQ1
Jan-15 17:25:34.911 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 82
Jan-15 17:25:34.913 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
Jan-15 17:25:34.919 [PuppetBridge] �[32minfo�[39m: New message by @eric:eric.nova.chat of type m.room.message to process!
172.20.0.2 - - [15/Jan/2020:17:25:34 +0000] "PUT /transactions/82?access_token=a59ca7d9-c389-4c3e-b387-b3b4a5b66dca HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
Jan-16 17:39:44.014 [Store] �[32minfo�[39m: Starting DB Init
Jan-16 17:39:44.035 [Store] �[32minfo�[39m: Filename present in config, using sqlite
Jan-16 17:39:44.038 [SQLite3] �[32minfo�[39m: Opening /data/twitter.db
Jan-16 17:39:44.068 [Store] �[32minfo�[39m: Database schema version is 6, latest version is 6
{ response_token: 'p5y5HVvEEP9pP9pTu23qYYGkpgn0=' }
Jan-16 17:39:45.251 [PuppetBridge] �[32minfo�[39m: Starting application service....
Jan-16 17:39:45.285 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) POST http://synapse:8008/_matrix/client/r0/register
Jan-16 17:39:45.342 [bot-sdk-MatrixLiteClient] �[31merror�[39m: (REQ-1) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Jan-16 17:39:45.348 [PuppetBridge] �[32minfo�[39m: Application service started!
Jan-16 17:39:45.349 [PuppetBridge] �[32minfo�[39m: Setting bridge user data...
Jan-16 17:39:45.350 [PuppetBridge] �[32minfo�[39m: Activating users...
Jan-16 17:39:45.360 [TwitterPuppet:Twitter] �[32minfo�[39m: Adding new Puppet: puppetId=1
Jan-16 17:39:45.607 [BotProvisioner] �[32minfo�[39m: Sending status message for puppetId 1...
Jan-16 17:39:45.659 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-2) PUT http://synapse:8008/_matrix/client/r0/rooms/!KZcUyaWYUGzlVAnIls%3Aeric.nova.chat/send/m.room.message/1579196385658__REQ1
Jan-16 17:39:47.460 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 83
Jan-16 17:39:47.463 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
172.20.0.2 - - [16/Jan/2020:17:39:47 +0000] "PUT /transactions/83?access_token=a59ca7d9-c389-4c3e-b387-b3b4a5b66dca HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
Jan-16 17:40:05.496 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-16 17:40:05.499 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-16 17:40:05.518 [UserSync] �[32minfo�[39m: Fetching client for 1144425621340078081
Jan-16 17:40:05.522 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) POST http://synapse:8008/_matrix/client/r0/register
Jan-16 17:40:05.538 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-3) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-16 17:40:05.594 [ChannelSync] �[32minfo�[39m: Fetching mxid for roomId 1144425621340078081 and puppetId 1
Jan-16 17:40:05.611 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-16 17:40:05.650 [bot-sdk-MatrixLiteClient] �[31merror�[39m: (REQ-1) { errcode: 'M_USER_IN_USE', error: 'User ID already taken.' }
Jan-16 17:40:05.652 [bot-sdk-Appservice] �[31merror�[39m: Error registering user: User ID is in use
Jan-16 17:40:05.681 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-16 17:40:05.707 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-2) PUT http://synapse:8008/_matrix/client/r0/rooms/!bZztJeWksThqaiKTkM%3Aeric.nova.chat/send/m.room.message/1579196405706__REQ1
Jan-16 17:40:06.420 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 84
Jan-16 17:40:06.423 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
Jan-16 17:40:06.430 [PuppetBridge] �[32minfo�[39m: New message by @eric:eric.nova.chat of type m.room.message to process!
172.20.0.2 - - [16/Jan/2020:17:40:06 +0000] "PUT /transactions/84?access_token=a59ca7d9-c389-4c3e-b387-b3b4a5b66dca HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
Jan-16 17:40:49.548 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) GET http://synapse:8008/_matrix/client/r0/account/whoami
Jan-16 17:40:49.584 [UserSync] �[32minfo�[39m: Fetching client for 844726645
Jan-16 17:40:49.587 [UserSync] �[32minfo�[39m: User doesn't exist yet, creating entry...
Jan-16 17:40:49.712 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-1) POST http://synapse:8008/_matrix/client/r0/register
Jan-16 17:40:53.347 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-2) PUT http://synapse:8008/_matrix/client/r0/profile/%40twitter1_844726645%3Aeric.nova.chat/displayname
Jan-16 17:40:53.485 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-3) POST http://synapse:8008/_matrix/media/r0/upload
Jan-16 17:40:54.629 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-4) PUT http://synapse:8008/_matrix/client/r0/profile/%40twitter1_844726645%3Aeric.nova.chat/avatar_url
Hi!
The old bridge used to do that @ https://half-shot.github.io/matrix-appservice-twitter/
Would that not be a nice idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.