Can anyone help with Pircbotx? Not listening. reddit / irc ---------------------------------------------------------------------- datguy__dev · 2019-06-02 14:35 Greetings, Right now I have a test activity going in Android Studio to mess around and learn before attempting a real app. I want to be able to read a Twitch chat from the app, so I'm trying to incorporate Pircbotx. For reason I haven't yet figured out, it appears the listener is not listening. Or perhaps the bot isn't connecting. Although no exceptions or errors are being thrown. ​ So in the main activity, I have a button start the irc client for now like so: `Button btn2 = findViewById(R.id.ircbtn); //use R.id for the button id` `btn2.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Log.e(" zzzzzz", "pushed irc button");try {IRC.Connect();} catch (Exception e) {e.printStackTrace();}}});` Then I have an IRC library, which is imported and called. `package com.example.test;import android.util.Log;import org.pircbotx.Configuration;import org.pircbotx.PircBotX;import org.pircbotx.cap.EnableCapHandler;import org.pircbotx.hooks.ListenerAdapter;import org.pircbotx.hooks.types.GenericMessageEvent;public class IRC {` `public static class MyListener extends ListenerAdapter {@Overridepublic void onGenericMessage(final GenericMessageEvent event) {Log.e(" zzzzzz", "starting get events");int cnt = 10;do {Log.e(" zzzzzz", event.getMessage());cnt--;} while (cnt > 0);Log.e(" zzzzzz", "done receiving");}}` `public static void Connect() throws Exception {Log.e(" zzzzzz", "building IRC");//Configure what we want our bot to doConfiguration.Builder configuration = new Configuration.Builder().setAutoNickChange(false) //Twitch doesn't support multiple users.setOnJoinWhoEnabled(false) //Twitch doesn't support WHO command.setCapEnabled(true).addCapHandler(new EnableCapHandler("twitch.tv/membership")) //Twitch by default doesn't send JOIN, PART, and NAMES unless you request it, see https://dev.twitch.tv/docs/irc/guide/#twitch-irc- capabilities.addServer("irc.twitch.tv").setName("twp_piebot") //Your twitch.tv username.setServerPassword("oauth:pchs-scramble-wcqe0ko22n") //Your oauth password from http://twitchapps.com/tmi.addAutoJoinChannel("#cohhcarnage") //Some twitch channel.addListener(new MyListener());//The rest of your config...//Create our bot with the configurationPircBotX bot = new PircBotX(configuration.buildConfiguration());//Connect to the serverLog.e(" zzzzzz", "bot starting");Log.e(" zzzzzz", "bot state: " + String.valueOf(bot.getState()));bot.startBot();}}`And here are the log events: `06-02 10:17:06.813 16682-16682/? E/ zzzzzz: on create (the start of the program)` `06-02 10:17:11.478 16682-16682/? E/ zzzzzz: pushed irc button` `06-02 10:17:11.478 16682-16682/? E/ zzzzzz: building IRC` `06-02 10:17:11.538 16682-16682/? E/ zzzzzz: bot starting` `06-02 10:17:11.538 16682-16682/? E/ zzzzzz: bot state: INIT` `06-02 10:23:57.141 18530-18530/? E/ zzzzzz: on create` `06-02 10:24:13.789 18530-18530/? E/ zzzzzz: pushed irc button` `06-02 10:24:13.819 18530-18530/? E/ zzzzzz: building IRC` `06-02 10:24:13.919 18530-18530/? E/ zzzzzz: bot starting` `06-02 10:24:13.919 18530-18530/? E/ zzzzzz: bot state: INIT` ​ I don't really get what is going on. As you can see, the bot starts and then nothing happens. I can't find the user in the viewer list of the channel. If anyone has any advice I'd appreciate it. This is the last hurdle for me before I start making the actual app. ---------------------------------------------------------------------- roboirc · 2019-06-26 17:32 Hi I came across your android related issue with pircbotx. Did you ever get it working? Thanks! ---------------------------------------------------------------------- datguy__dev · 2019-06-27 01:22 Nope. I manually made an IRC client and glad I did in the end. ---------------------------------------------------------------------- roboirc · 2019-10-02 14:40 I finally got it working. Here is github: [https://github.com/pircbotx /pircbotx](https://github.com/pircbotx/pircbotx) Apparently it only connects via SSL in default and you have to run it in thread.