This commit is contained in:
Dawid Wysokiński 2021-07-18 12:38:57 +02:00
parent 0e45085f2a
commit c5ef99b731
1 changed files with 62 additions and 59 deletions

View File

@ -115,9 +115,13 @@ func (p *procTranslateCoords) process(ctx *commandCtx, m *discordgo.MessageCreat
if ctx.server.CoordsTranslation == "" {
return
}
coords := coordsRegex.FindAllString(m.Content, -1)
coordsLen := len(coords)
if coordsLen > 0 {
if coordsLen <= 0 {
return
}
version, err := p.cfg.API.Version.Read(twmodel.VersionCodeFromServerKey(ctx.server.CoordsTranslation))
if err != nil || version == nil {
return
@ -176,5 +180,4 @@ func (p *procTranslateCoords) process(ctx *commandCtx, m *discordgo.MessageCreat
p.SendEmbed(m.ChannelID, NewEmbed().
SetTitle(title).
SetFields(bldr.ToMessageEmbedFields()))
}
}