-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add discord example #25
Conversation
.changeset/cuddly-mangos-train.md
Outdated
@@ -0,0 +1,6 @@ | |||
--- | |||
'@callstack/byorg-discord': minor | |||
'discord-example': patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] implementing example actually accounts as a minor ;-)
'discord-example': patch | |
'discord-example': minor |
examples/discord/package.json
Outdated
@@ -15,13 +15,14 @@ | |||
"dependencies": { | |||
"@ai-sdk/openai": "^1.0.2", | |||
"@callstack/byorg-core": "0.4.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you replace all 0.4.2 references with workspace (in every package)? There was a bug if you released it with changeset, but now we do release it with pnpm
so we can use workspace
packages/discord/package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@callstack/byorg-discord", | |||
"version": "0.4.2", | |||
"version": "0.4.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave version updating to changset
packages/discord/src/index.ts
Outdated
start: () => Promise<string>; | ||
}; | ||
|
||
export type DiscordClient = Client & ClientStart; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add code comment documenting this hack
packages/discord/src/index.ts
Outdated
@@ -76,7 +82,9 @@ export async function createDiscordApp(options: DiscordApplicationConfig) { | |||
await pendingEffects; | |||
}); | |||
|
|||
await client.login(botToken); | |||
client.start = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding methods to existing discord object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make usage of discord the same as slack, and to abstract away the "login" method that takes in the bot token as an argument.
packages/discord/src/index.ts
Outdated
@@ -76,7 +82,9 @@ export async function createDiscordApp(options: DiscordApplicationConfig) { | |||
await pendingEffects; | |||
}); | |||
|
|||
await client.login(botToken); | |||
client.start = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see any code in this PR actually calling this method. Is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions in the comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved!
Summary
new example for discord integration
Test plan
tested with discord