feat(adapter-twitter): add new Twitter/X webhook adapter#275
feat(adapter-twitter): add new Twitter/X webhook adapter#275JimiPatel2023 wants to merge 1 commit intovercel:mainfrom
Conversation
|
@JimiPatel2023 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
only commenting bc @JimiPatel2023 and I independently encountered this issue at similar times, and spent time quietly deep diving our solutions in parallel. i left my fork online to compare solutions. my comments are my bookkeeping that we checked mostly the same conditions. it was neat
i left some nitpicks in the README, but overall its LGTM.
| 2. Generate your **Consumer Key**, **Consumer Secret**, and **Bearer Token**. | ||
| 3. Set up **OAuth 1.0a User Authentication** in your app settings with Read/Write/Direct Messages permissions. | ||
| 4. Generate the **Access Token** and **Access Token Secret** for your bot account. | ||
| 5. Apply for the **Account Activity API** (requires Pro or Enterprise access). |
There was a problem hiding this comment.
Step 5 required more research for me to understand. Some tweaks to help the next fella:
-
"Apply for..." – cant find the application – can you attach a link?
-
"Account Activity API" – specify version (Enterprise or V2)?
| }); | ||
| }); | ||
|
|
||
| describe("thread ID encoding/decoding", () => { |
There was a problem hiding this comment.
| }); | ||
| }); | ||
|
|
||
| describe("renderFormatted", () => { |
There was a problem hiding this comment.
| }); | ||
| }); | ||
|
|
||
| describe("editMessage", () => { |
There was a problem hiding this comment.
| }); | ||
|
|
||
| describe("fetchThread", () => { | ||
| it("should return thread info", async () => { |
There was a problem hiding this comment.
| describe("fetchMessages", () => { | ||
| it("should return empty array for unknown thread", async () => { | ||
| const adapter = createTestAdapter(); | ||
| const result = await adapter.fetchMessages("twitter:unknown"); |
There was a problem hiding this comment.
| }); | ||
|
|
||
| describe("parseMessage", () => { | ||
| it("should parse a raw DM event into a Message", () => { |
There was a problem hiding this comment.
| }); | ||
| }); | ||
|
|
||
| describe("isDM", () => { |
There was a problem hiding this comment.
Description
This PR introduces a brand new, fully-featured adapter for Twitter / X.
It implements the Adapter interface to handle Direct Messages via the Enterprise Account Activity API (webhooks) and the v2 REST API to reply to users.
Features
Related Changes
@chat-adapter/twitterto vitest workspaces.sample-messages.mdand complete configurationREADME.md.