~kris/9p

glenda

5a3dd002509396cc22635ea78f0236a6987aeb15 — Henesy 5 years ago 5cf07b1
add guard for slice index 0 - crashed 12/13 for unknown reasons on this (had size 0)
1 files changed, 1 insertions(+), 1 deletions(-)

M x/mux/mux.go
M x/mux/mux.go => x/mux/mux.go +1 -1
@@ 153,7 153,7 @@ func (m *Mux) OnMessageCreate(ds *discordgo.Session, mc *discordgo.MessageCreate
				reg := regexp.MustCompile(fmt.Sprintf("<@!?(%s)>", ds.State.User.ID))

				// Was the @mention the first part of the string?
				if reg.FindStringIndex(ctx.Content)[0] == 0 {
				if len(reg.FindStringIndex(ctx.Content)) > 0 && reg.FindStringIndex(ctx.Content)[0] == 0 {
					ctx.HasMentionFirst = true
				}