Skip to content
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

Merged
merged 8 commits into from
Dec 7, 2024
Merged

chore: add discord example #25

merged 8 commits into from
Dec 7, 2024

Conversation

Q1w1N
Copy link
Collaborator

@Q1w1N Q1w1N commented Dec 5, 2024

Summary

new example for discord integration

Test plan

tested with discord

@@ -0,0 +1,6 @@
---
'@callstack/byorg-discord': minor
'discord-example': patch
Copy link
Member

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 ;-)

Suggested change
'discord-example': patch
'discord-example': minor

@@ -15,13 +15,14 @@
"dependencies": {
"@ai-sdk/openai": "^1.0.2",
"@callstack/byorg-core": "0.4.2",
Copy link
Member

@mdjastrzebski mdjastrzebski Dec 5, 2024

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

@@ -1,6 +1,6 @@
{
"name": "@callstack/byorg-discord",
"version": "0.4.2",
"version": "0.4.3",
Copy link
Member

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

start: () => Promise<string>;
};

export type DiscordClient = Client & ClientStart;
Copy link
Member

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

@@ -76,7 +82,9 @@ export async function createDiscordApp(options: DiscordApplicationConfig) {
await pendingEffects;
});

await client.login(botToken);
client.start = () => {
Copy link
Member

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?

Copy link
Collaborator Author

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.

@@ -76,7 +82,9 @@ export async function createDiscordApp(options: DiscordApplicationConfig) {
await pendingEffects;
});

await client.login(botToken);
client.start = () => {
Copy link
Member

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?

Copy link
Collaborator Author

@Q1w1N Q1w1N Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now added

Copy link
Member

@mdjastrzebski mdjastrzebski left a 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

Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@mdjastrzebski mdjastrzebski merged commit 5e25d3a into main Dec 7, 2024
2 checks passed
@mdjastrzebski mdjastrzebski deleted the chore/discord-example branch December 7, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants