Skip to content

chore: add discord example - #25

Merged
mdjastrzebski merged 8 commits into
mainfrom
chore/discord-example
Dec 7, 2024
Merged

chore: add discord example#25
mdjastrzebski merged 8 commits into
mainfrom
chore/discord-example

Conversation

@Q1w1N

@Q1w1N Q1w1N commented Dec 5, 2024

Copy link
Copy Markdown
Collaborator

Summary

new example for discord integration

Test plan

tested with discord

Comment thread .changeset/cuddly-mangos-train.md Outdated
@@ -0,0 +1,6 @@
---
'@callstack/byorg-discord': minor
'discord-example': patch

Copy link
Copy Markdown
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

Comment thread examples/discord/package.json Outdated
@@ -15,13 +15,14 @@
"dependencies": {
"@ai-sdk/openai": "^1.0.2",
"@callstack/byorg-core": "0.4.2",

@mdjastrzebski mdjastrzebski Dec 5, 2024

Copy link
Copy Markdown
Member

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

Comment thread packages/discord/package.json Outdated
{
"name": "@callstack/byorg-discord",
"version": "0.4.2",
"version": "0.4.3",

Copy link
Copy Markdown
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

Comment thread packages/discord/src/index.ts Outdated
start: () => Promise<string>;
};

export type DiscordClient = Client & ClientStart;

Copy link
Copy Markdown
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

Comment thread packages/discord/src/index.ts Outdated
});

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

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread packages/discord/src/index.ts Outdated
});

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

Copy link
Copy Markdown
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?

@Q1w1N Q1w1N Dec 5, 2024

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Now added

@mdjastrzebski mdjastrzebski left a comment

Copy link
Copy Markdown
Member

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

Comment thread .changeset/cuddly-mangos-train.md Outdated

@mdjastrzebski mdjastrzebski left a comment

Copy link
Copy Markdown
Member

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
@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