From: Rudolf Polzer Date: Fri, 18 Feb 2022 00:07:15 +0000 (+0100) Subject: Oops, fix the errors. X-Git-Tag: xonotic-v0.8.5~25 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff4dd68a7cbc125938508181fb0616f4c7930576;p=xonotic%2Fxonotic.git Oops, fix the errors. Now the bot handles kicks right. --- diff --git a/misc/infrastructure/powerbot/bot.go b/misc/infrastructure/powerbot/bot.go index 2f26ff00..4c8b2f53 100644 --- a/misc/infrastructure/powerbot/bot.go +++ b/misc/infrastructure/powerbot/bot.go @@ -197,11 +197,16 @@ func Run() (err error) { return } mem := evt.Content.AsMember() + key := evt.StateKey + if key == nil { + return + } + member := id.UserID(*key) switch mem.Membership { case event.MembershipJoin: - handleJoin(eventTime(evt), evt.RoomID, evt.StateKey, evt) + handleJoin(eventTime(evt), evt.RoomID, member, evt) case event.MembershipLeave: - handleLeave(eventTime(evt), evt.RoomID, evt.StateKey, evt) + handleLeave(eventTime(evt), evt.RoomID, member, evt) default: // Ignore. } })