Skip to content

Commit

Permalink
Merge pull request #164 from kylepokorski/main
Browse files Browse the repository at this point in the history
Fix #157
  • Loading branch information
Nv7-GitHub authored Feb 11, 2025
2 parents e9d044c + 578d7f3 commit d9b768a
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions eod/categories/infoedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func (c *Categories) MsgSignCmd(ctx sevcord.Ctx, cat string, mark string) {
Kind: types.PollKindCatComment,
Data: types.PgData{
"cat": name,
"new": mark,
"old": old,
"new": mark,
"old": old,
},
})
if !res.Ok {
Expand Down Expand Up @@ -105,40 +105,6 @@ func (c *Categories) SignCmd(ctx sevcord.Ctx, opts []any) {
}).Input(sevcord.NewModalInput("New Comment", "None", sevcord.ModalInputStyleParagraph, 2400)))
}

func (c *Categories) MsgSignCmd(ctx sevcord.Ctx, cat string, mark string) {
ctx.Acknowledge()

var name string
var old string
err := c.db.QueryRow("SELECT name, comment FROM categories WHERE LOWER(name)=$1 AND guild=$2", strings.ToLower(cat), ctx.Guild()).Scan(&name, &old)
if err != nil {
if err == sql.ErrNoRows {
ctx.Respond(sevcord.NewMessage("Element **" + cat + "** doesn't exist! " + types.RedCircle))
return
} else {
c.base.Error(ctx, err)
return
}
}

// Make poll
res := c.polls.CreatePoll(ctx, &types.Poll{
Kind: types.PollKindCatComment,
Data: types.PgData{
"cat": name,
"new": mark,
"old": old,
},
})
if !res.Ok {
ctx.Respond(res.Response())
return
}

// Respond
ctx.Respond(sevcord.NewMessage(fmt.Sprintf("Suggested a note for **%s** 🖋️", name)))
}

func (c *Categories) ColorCmd(ctx sevcord.Ctx, opts []any) {
ctx.Acknowledge()

Expand Down

0 comments on commit d9b768a

Please sign in to comment.