From df0b5d709bc0a58dbd64bff97472a709c681bade Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Sun, 17 Jul 2022 13:48:35 -0400 Subject: [PATCH] counter: fix bug where user ID was not passed to resolveUser --- plugins/counter/api.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/counter/api.go b/plugins/counter/api.go index 95d3f79..946783c 100644 --- a/plugins/counter/api.go +++ b/plugins/counter/api.go @@ -211,7 +211,19 @@ func (p *CounterPlugin) handleCounterAPI(w http.ResponseWriter, r *http.Request) w.Write(j) return } - nick, id := p.resolveUser(bot.Request{Conn: p.b.DefaultConnector()}, info.User) + req := bot.Request{ + Conn: p.b.DefaultConnector(), + Kind: bot.Message, + Msg: msg.Message{ + User: &user.User{ + ID: "", + Name: info.User, + Admin: false, + }, + }, + } + // resolveUser requires a "full" request object so we are faking it + nick, id := p.resolveUser(req, info.User) item, err := GetUserItem(p.db, nick, id, info.Thing) if err != nil { log.Error().