telegram-notifications-plugin icon indicating copy to clipboard operation
telegram-notifications-plugin copied to clipboard

The bot does not work. At all.

Open anydoby opened this issue 4 years ago • 5 comments
trafficstars

Hello fellow developers

I have installed the bot, and followed the guide. I configured the bot name and token. Here's what I see in the jenkins log:

2021-02-08 14:09:06.889+0000 [id=44] INFO j.p.t.telegram.TelegramBotRunner#lambda$new$0: There is no reason for bot recreating 2021-02-08 14:13:29.607+0000 [id=44] INFO j.p.t.telegram.TelegramBot#initializeProxy: Proxy successfully initialized 2021-02-08 14:13:29.613+0000 [id=44] INFO j.p.t.telegram.TelegramBotRunner#lambda$new$0: Bot was created

I assume this means the bot was started.

I put this to my pipeline:

post {
    always {            
        telegramSend '${currentBuild.projectName} ${currentBuild.displayName} ${currentBuild.result}'   
    }
}

The build is successful. But I get no notifications in telegram chat. Also /start and /sub and /help do not return any answer. What could be wrong?

anydoby avatar Feb 08 '21 14:02 anydoby

Also /start and /sub and /help do not return any answer

same for me

maks-rafalko avatar Feb 08 '21 15:02 maks-rafalko

I'll have a look at the code, when I have the time. But can't promise anything soon. To me it looks like it must work, at least my bots look similar. Maybe the authors have more insight?

anydoby avatar Feb 08 '21 22:02 anydoby

The same problem. When I send any command (/start and /sub and /help), the jenkins log has an error:

Feb 27, 2021 1:30:30 PM SEVERE org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread run

null
java.lang.NullPointerException
	at java.util.regex.Pattern.quote(Pattern.java:1291)
	at org.telegram.telegrambots.extensions.bots.commandbot.commands.CommandRegistry.removeUsernameFromCommandIfNeeded(CommandRegistry.java:126)
	at org.telegram.telegrambots.extensions.bots.commandbot.commands.CommandRegistry.executeCommand(CommandRegistry.java:103)
	at org.telegram.telegrambots.extensions.bots.commandbot.TelegramLongPollingCommandBot.onUpdateReceived(TelegramLongPollingCommandBot.java:78)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.telegram.telegrambots.meta.generics.LongPollingBot.onUpdatesReceived(LongPollingBot.java:27)
	at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread.run(DefaultBotSession.java:312)

When the bot tries to send a message:

Feb 27, 2021 1:07:50 PM SEVERE jenkinsci.plugins.telegrambot.telegram.TelegramBot sendMessage

Error while sending the message
java.net.URISyntaxException: Illegal character in path at index 28: https://api.telegram.org/bot{A...==}/sendmessage
	at java.net.URI$Parser.fail(URI.java:2847)
	at java.net.URI$Parser.checkChars(URI.java:3020)
	at java.net.URI$Parser.parseHierarchical(URI.java:3104)
	at java.net.URI$Parser.parse(URI.java:3052)
	at java.net.URI.<init>(URI.java:588)
	at java.net.URI.create(URI.java:850)

johnkarpn avatar Feb 27 '21 10:02 johnkarpn

Please fix the problem of the URL encoding error, thats a major showstopper right now in our CI.

Flohack74 avatar Apr 05 '21 21:04 Flohack74

The same problem. When I send any command (/start and /sub and /help), the jenkins log has an error:

Feb 27, 2021 1:30:30 PM SEVERE org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread run

null
java.lang.NullPointerException
	at java.util.regex.Pattern.quote(Pattern.java:1291)
	at org.telegram.telegrambots.extensions.bots.commandbot.commands.CommandRegistry.removeUsernameFromCommandIfNeeded(CommandRegistry.java:126)
	at org.telegram.telegrambots.extensions.bots.commandbot.commands.CommandRegistry.executeCommand(CommandRegistry.java:103)
	at org.telegram.telegrambots.extensions.bots.commandbot.TelegramLongPollingCommandBot.onUpdateReceived(TelegramLongPollingCommandBot.java:78)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.telegram.telegrambots.meta.generics.LongPollingBot.onUpdatesReceived(LongPollingBot.java:27)
	at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread.run(DefaultBotSession.java:312)

When the bot tries to send a message:

Feb 27, 2021 1:07:50 PM SEVERE jenkinsci.plugins.telegrambot.telegram.TelegramBot sendMessage

Error while sending the message
java.net.URISyntaxException: Illegal character in path at index 28: https://api.telegram.org/bot{A...==}/sendmessage
	at java.net.URI$Parser.fail(URI.java:2847)
	at java.net.URI$Parser.checkChars(URI.java:3020)
	at java.net.URI$Parser.parseHierarchical(URI.java:3104)
	at java.net.URI$Parser.parse(URI.java:3052)
	at java.net.URI.<init>(URI.java:588)
	at java.net.URI.create(URI.java:850)
public TelegramBot(String token, String name) {
    super(name);
    this.token = Secret.fromString(token).getPlainText();

    initializeProxy();

    Arrays.asList(
            new StartCommand(),
            new HelpCommand(),
            new SubCommand(),
            new UnsubCommand(),
            new StatusCommand()
    ).forEach(this::register);
}

offSwitch avatar Aug 30 '21 09:08 offSwitch