mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-11-09 15:40:03 +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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
logger := log.WithFields(log.Fields{
|
logger := log.WithField("user", p.User.ID)
|
||||||
"name": p.User.Username,
|
|
||||||
"user": p.User.ID,
|
|
||||||
})
|
|
||||||
|
|
||||||
member, err := d.GuildMember(p.GuildID, p.User.ID)
|
member, err := d.GuildMember(p.GuildID, p.User.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -88,6 +85,8 @@ func (m modLiveRole) handlePresenceUpdate(d *discordgo.Session, p *discordgo.Pre
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger = logger.WithField("name", member.User.String())
|
||||||
|
|
||||||
// @attr role_streamers optional string "" Only take members with this role ID into account
|
// @attr role_streamers optional string "" Only take members with this role ID into account
|
||||||
roleStreamer := m.attrs.MustString("role_streamers", ptrStringEmpty)
|
roleStreamer := m.attrs.MustString("role_streamers", ptrStringEmpty)
|
||||||
if roleStreamer != "" && !str.StringInSlice(roleStreamer, member.Roles) {
|
if roleStreamer != "" && !str.StringInSlice(roleStreamer, member.Roles) {
|
||||||
|
|
Loading…
Reference in a new issue