-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
Hey guys,
appreciate your amazing work!
Right now using e.g. the matrix (beeper) platform adapter does not allow to use the chat.openDm(userId) functionality because
chat/packages/chat/src/chat.ts
Line 1527 in 9182017
| private inferAdapterFromUserId(userId: string): Adapter { |
Can't go on checking if it's even working for now..
Proposed Solution
A platform adapter should implement it's own inference rules and register it's inference rule to the chat sdk.
If an rule already exists it should be overriden or throw an exception - whatever is your opinion on that.
Alternatives Considered
Other approaches are welcome
Use Case
import { createMatrixAdapter } from "@beeper/chat-adapter-matrix";
import { Chat } from "chat";
const adapterOptions = {
baseURL: process.env.MATRIX_BASE_URL!,
auth: {
type: "accessToken",
accessToken: process.env.MATRIX_ACCESS_TOKEN!,
userID: process.env.MATRIX_USER_ID,
},
} satisfies MatrixAdapterConfig;
export const bot = new Chat({
userName: "botbotbot",
adapters: {
matrix: createMatrixAdapter(adapterOptions),
},
state: createMemoryState(),
});
await bot.initialize();
const dmThread = await bot.openDM("@user_id:matrix.org");
await dmThread.post("I'm aliveeeeee");Priority
None
Contribution
- I am willing to help implement this feature
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request