Twitter streaming

Hi, I am trying to add a command to my bot to monitor some twitter/X accounts. The operation is very simple, when a user I monitor posts a tweet the bot should send a message in a text channel where it puts the link to the tweet. I have tried searching online but continuously get this error:
API error: TwitterError: Client Forbidden: When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.
at module.exports.fromJson (C:\Users\arago\Downloads\play-netbot-main (1)\play-netbot-main\node_modules\twitter-v2\build\TwitterError.js:26:16)
at Twitter.get (C:\Users\arago\Downloads\play-netbot-main (1)\play-netbot-main\node_modules\twitter-v2\build\twitter.js:43:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.execute (C:\Users\arago\Downloads\play-netbot-main (1)\play-netbot-main\Events\client\monitor\twitter.js:20:25) {
details: 'https://api.twitter.com/2/problems/client-forbidden'
}
API error: TwitterError: Client Forbidden: When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.
at module.exports.fromJson (C:\Users\arago\Downloads\play-netbot-main (1)\play-netbot-main\node_modules\twitter-v2\build\TwitterError.js:26:16)
at Twitter.get (C:\Users\arago\Downloads\play-netbot-main (1)\play-netbot-main\node_modules\twitter-v2\build\twitter.js:43:49)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.execute (C:\Users\arago\Downloads\play-netbot-main (1)\play-netbot-main\Events\client\monitor\twitter.js:20:25) {
details: 'https://api.twitter.com/2/problems/client-forbidden'
}
This is my code: https://pastebin.com/XA3rqfuR Thank you
Pastebin
twitter monitor - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
5 Replies
d.js toolkit
d.js toolkit10mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna10mo ago
Not djs related, #other-js-ts the api also is paid now iirc
Simone
Simone10mo ago
Sorry if I got the wrong channel, the app made me create it on the twitter developer site. Should I ask in the other channel?
treble/luna
treble/luna10mo ago
yes
Simone
Simone10mo ago
ok