{"action":"closed","issue":{"url":"https://api.github.com/repos/rubenlagus/TelegramBots/issues/151","repository_url":"https://api.github.com/repos/rubenlagus/TelegramBots","labels_url":"https://api.github.com/repos/rubenlagus/TelegramBots/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/rubenlagus/TelegramBots/issues/151/comments","events_url":"https://api.github.com/repos/rubenlagus/TelegramBots/issues/151/events","html_url":"https://github.com/rubenlagus/TelegramBots/issues/151","id":183286306,"number":151,"title":"sendMessage error","user":{"login":"alevdyk","id":12669439,"avatar_url":"https://avatars.githubusercontent.com/u/12669439?v=3","gravatar_id":"","url":"https://api.github.com/users/alevdyk","html_url":"https://github.com/alevdyk","followers_url":"https://api.github.com/users/alevdyk/followers","following_url":"https://api.github.com/users/alevdyk/following{/other_user}","gists_url":"https://api.github.com/users/alevdyk/gists{/gist_id}","starred_url":"https://api.github.com/users/alevdyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alevdyk/subscriptions","organizations_url":"https://api.github.com/users/alevdyk/orgs","repos_url":"https://api.github.com/users/alevdyk/repos","events_url":"https://api.github.com/users/alevdyk/events{/privacy}","received_events_url":"https://api.github.com/users/alevdyk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-16T19:38:16Z","updated_at":"2016-10-16T20:31:14Z","closed_at":"2016-10-16T20:31:14Z","body":"Hi. I have an error in this piece of code in case when type.equals('s')\r\nin other situations everything works fine. \r\nthe problem is the error itself say nothing about what is wrong, I've spent like  two hours already and nothing changes. In case _type=t_ it sends the message, in case _type=s_ - no. \r\n```\r\nString text = \"You user-type has been modified.\";\t\t\r\nif (type.equals('s')) {\r\n\t\t\t\ttext = text + \"Use /set GROUP_ID to set your group id. \\n📚For example: /set CE-I1NP\";\r\n\t\t\t\tsendTextOnly(message,text);\r\n\t\t\t} \r\nif (type.equals('t')) {\r\n\t\t\t\ttext = text + \"Use /set NAME SURNAME to set your personal data. \\n📚For example /set Walesa Lech\";\r\n\t\t\t\tsendTextOnly(message,text);\r\n\t\t\t}\r\n```\r\n\r\nhere is the sendTextOnly method \r\n\r\n```\r\nprivate void sendTextOnly(Message message, String text) {\r\n\t\tSendMessage sendMessage = new SendMessage();\r\n\t\tsendMessage.enableMarkdown(true);\r\n\t\tsendMessage.setChatId(message.getChatId().toString());\r\n\t\tsendMessage.setText(text);\r\n\t\tsendMessage.setReplayMarkup(new ReplyKeyboardHide());\r\n\t\ttry {\r\n\t\t\tsendMessage(sendMessage);\r\n\t\t} catch (TelegramApiException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}\r\n```\r\n\r\nand the stack trace\r\n\r\n```\r\norg.telegram.telegrambots.TelegramApiException: Error at sendmessage\r\n\tat org.telegram.telegrambots.bots.AbsSender.sendApiMethod(AbsSender.java:435)\r\n\tat org.telegram.telegrambots.bots.AbsSender.sendMessage(AbsSender.java:51)\r\n\tat test.VistulaBot.sendTextOnly(VistulaBot.java:274)\r\n\tat test.VistulaBot.setType(VistulaBot.java:353)\r\n\tat test.VistulaBot.handleMesssage(VistulaBot.java:95)\r\n\tat test.VistulaBot.onUpdateReceived(VistulaBot.java:61)\r\n\tat org.telegram.telegrambots.updatesreceivers.UpdatesThread$HandlerThread.run(UpdatesThread.java:124)\r\n```\r\n\r\n!!!!!!!!!**SOLVED**!!!!!!!!!!!!\r\nfinally after 2 hours of painful runs and debugging I find out that _ (underscore) symbol in message text was a problem.  kind of stupid limitation, but it works. "}}
{"actor":{"display_login":"rubenlagus"}}