discord: add nosendjoinpart support
This allows the discord bridge to be configured with `nosendjoinpart`, preventing discord-originating join/part messages from being send to other bridged platforms.
This commit is contained in:
@@ -171,6 +171,9 @@ func (b *Bdiscord) memberUpdate(s *discordgo.Session, m *discordgo.GuildMemberUp
|
||||
}
|
||||
|
||||
func (b *Bdiscord) memberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd) {
|
||||
if b.GetBool("nosendjoinpart") {
|
||||
return
|
||||
}
|
||||
if m.Member == nil {
|
||||
b.Log.Warnf("Received member update with no member information: %#v", m)
|
||||
return
|
||||
@@ -192,6 +195,9 @@ func (b *Bdiscord) memberAdd(s *discordgo.Session, m *discordgo.GuildMemberAdd)
|
||||
}
|
||||
|
||||
func (b *Bdiscord) memberRemove(s *discordgo.Session, m *discordgo.GuildMemberRemove) {
|
||||
if b.GetBool("nosendjoinpart") {
|
||||
return
|
||||
}
|
||||
if m.Member == nil {
|
||||
b.Log.Warnf("Received member update with no member information: %#v", m)
|
||||
return
|
||||
|
||||
@@ -197,7 +197,7 @@ ShowJoinPart=false
|
||||
VerboseJoinPart=false
|
||||
|
||||
#Do not send joins/parts to other bridges
|
||||
#Currently works for messages from the following bridges: irc, mattermost, slack
|
||||
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
|
||||
#OPTIONAL (default false)
|
||||
NoSendJoinPart=false
|
||||
|
||||
@@ -496,7 +496,7 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
|
||||
ShowJoinPart=false
|
||||
|
||||
#Do not send joins/parts to other bridges
|
||||
#Currently works for messages from the following bridges: irc, mattermost, slack
|
||||
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
|
||||
#OPTIONAL (default false)
|
||||
NoSendJoinPart=false
|
||||
|
||||
@@ -830,7 +830,7 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
|
||||
ShowJoinPart=false
|
||||
|
||||
#Do not send joins/parts to other bridges
|
||||
#Currently works for messages from the following bridges: irc, mattermost, slack
|
||||
#Currently works for messages from the following bridges: irc, mattermost, slack, discord
|
||||
#OPTIONAL (default false)
|
||||
NoSendJoinPart=false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user