From 1e764dfaf279af14540fe1916c1847c7ec3d099c Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 6 Nov 2018 14:12:13 +0200 Subject: [PATCH] Allow hyphen character in switchPmParameter --- .../telegrambots/meta/api/methods/AnswerInlineQuery.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java index 80fb9434..5c341c80 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java @@ -136,8 +136,8 @@ public class AnswerInlineQuery extends BotApiMethod { if (switchPmParameter.length() > 64) { throw new TelegramApiValidationException("SwitchPmParameter can't be longer than 64 chars", this); } - if (!Pattern.matches("[A-Za-z0-9_]+", switchPmParameter.trim() )) { - throw new TelegramApiValidationException("SwitchPmParameter only allows A-Z, a-z, 0-9 and _ characters", this); + if (!Pattern.matches("[A-Za-z0-9_\\-]+", switchPmParameter.trim() )) { + throw new TelegramApiValidationException("SwitchPmParameter only allows A-Z, a-z, 0-9, _ and - characters", this); } } for (InlineQueryResult result : results) {