From 90b2c369b5ec72c1b87717cbc4e04bd770472ff5 Mon Sep 17 00:00:00 2001 From: Luther Wen Xu Date: Fri, 11 Oct 2019 22:35:44 +0800 Subject: [PATCH] go: Enforce length limit on vote --- GoBot/command_vote.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GoBot/command_vote.go b/GoBot/command_vote.go index 3ea69c7..0766c7b 100644 --- a/GoBot/command_vote.go +++ b/GoBot/command_vote.go @@ -106,6 +106,10 @@ func voteSuggestion(s *discordgo.Session, m *discordgo.MessageCreate) { sendPrivateMessage(s, m.Author.ID, "请提供更多资料。\nPlease provide more information.") return } + if len(args[1]) > 500 { + sendPrivateMessage(s, m.Author.ID, "你投票的内容过长了。请使用少过500个字符。\nYour vote is too long. Please use a maximum of 500 characters.") + return + } switch args[0] { case "custom":