-
Notifications
You must be signed in to change notification settings - Fork 30
refactor: use embed in !oc command + add sendEmbedToChannel to ChatService #80
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
base: main
Are you sure you want to change the base?
Conversation
| const content = userId ? `<@${userId}>` : undefined; | ||
|
|
||
| const embed = new EmbedBuilder() | ||
| .setTitle("🚫 Canal Exclusivo para Programação") |
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.
Not really Canal Exclusivo but rule of thumb is that the entire server is for programming or programming related topics
Title should follow the description
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.
Yup you're right, i need to change that part
| const userId = mentionedUser?.id || userIdMatch?.[1] || userIdMatch?.[2]; | ||
| const content = userId ? `<@${userId}>` : undefined; | ||
|
|
||
| const embed = new EmbedBuilder() |
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.
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.
Yes Markdown is another easy solution, i usually use embeds because you can input footers and/or icons on them, i usually produce hundreds of them and they are not THAT heavy, but they are simple to edit and manipulate
The idea was to get rid of simple texting, which can introduce ping flaws, but Markdown also solves it yes
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.
adding !oc @someUserToBeMentioned would be a lukewarm feature but I can see some general value in case the chat is too long already.
Maybe it's a nice-to-have and nice-to-have's aren't that problematic for this community-based bot.
As for the embed, shouldn't be a problem as long as it doesn't occupy a lot of the user-space.
Just my 2 cents. I'm not a maintainer, just a casual contributor
| async sendEmbedToChannel(embed: EmbedBuilder, channelId: string, content?: string): Promise<void> { | ||
| const channel = await this.client.channels.fetch(channelId); | ||
|
|
||
| if (!channel || !channel.isTextBased()) { |
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.
there's code duplication in l.20-22 and l.10-12
Could improve with a function that always returns a TextChannel or throws an Error

No description provided.