mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-12-19 18:01:23 +00:00
[liverole] Fix: Take username from member information
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
9bc19f0451
commit
60146d4fe1
1 changed files with 3 additions and 4 deletions
|
@ -77,10 +77,7 @@ func (m modLiveRole) handlePresenceUpdate(d *discordgo.Session, p *discordgo.Pre
|
|||
return
|
||||
}
|
||||
|
||||
logger := log.WithFields(log.Fields{
|
||||
"name": p.User.Username,
|
||||
"user": p.User.ID,
|
||||
})
|
||||
logger := log.WithField("user", p.User.ID)
|
||||
|
||||
member, err := d.GuildMember(p.GuildID, p.User.ID)
|
||||
if err != nil {
|
||||
|
@ -88,6 +85,8 @@ func (m modLiveRole) handlePresenceUpdate(d *discordgo.Session, p *discordgo.Pre
|
|||
return
|
||||
}
|
||||
|
||||
logger = logger.WithField("name", member.User.String())
|
||||
|
||||
// @attr role_streamers optional string "" Only take members with this role ID into account
|
||||
roleStreamer := m.attrs.MustString("role_streamers", ptrStringEmpty)
|
||||
if roleStreamer != "" && !str.StringInSlice(roleStreamer, member.Roles) {
|
||||
|
|
Loading…
Reference in a new issue