go: Enforce length limit on vote

master
Luther Wen Xu 2019-10-11 22:35:44 +07:00
parent a8fbc2390f
commit 90b2c369b5
Signed by untrusted user: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
1 changed files with 4 additions and 0 deletions

@ -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":