-
Notifications
You must be signed in to change notification settings - Fork 618
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
Add support for discord forum channels/threads (discord) #1914
base: master
Are you sure you want to change the base?
Conversation
@tomabrafix sorry for the long delay on response for this PR, are you still willing to work on it and rebase it? |
any update on tis? |
Might take a look at this later... a bit busy these days :P |
0ac10a4
to
11a6985
Compare
// Returns messageID and error. | ||
func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordgo.Message, error) { | ||
func (b *Bdiscord) webhookSendThread(msg *config.Message, channelID string, threadID string) (*discordgo.Message, error) { |
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.
Method Bdiscord.webhookSendThread
has 52 lines of code (exceeds 50 allowed). Consider refactoring.
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 think a shorter function (even by two lines) will improve the understanding of this code. Is it possible to ignore the "issue" at this point?
Merge it merge it |
Messages send to forum threads need to use the ID of the forum for the webhook but also need to set an additional parameter during the API call to specify the destination thread. Receiving messages from threads works by using the thread ID. The forum ID is not required. This commit adds an optional channel option "ForumID" which can be used to supply the forum ID of a thread (= channel). When sending/editing messages the ForumID will be used for the webhook and the channel ID will be supplied as the additional parameter "thread_id". Fixes 42wim#1908
11a6985
to
3e3090f
Compare
Code Climate has analyzed commit 3e3090f and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
I currently use matterbridge to bridge an IRC and a discord server. This feature would greatly improve the user experience, is it ready to merge ? |
From my point of view it can be merged |
How would i use this to mirror i.e. slack threads with discord threads? |
If I understand Slack correctly, Slack Threads and Discord "Threads" are different concepts and should not be mirrored: |
Messages send to forum threads need to use the ID of the forum for the webhook but also need to set an additional parameter during the API call to specify the destination thread.
Receiving messages from threads works by using the thread ID. The forum ID is not required.
This commit adds an optional channel option "ForumID" which can be used to supply the forum ID of a thread (= channel). When sending/editing messages the ForumID will be used for the webhook and the channel ID will be supplied as the additional parameter "thread_id".
Fixes #1908