Trouble trying to receive messages at a IRC twitch bot

I’m trying to make a chat bot for a twitch channel, but when I use the method onMessage, from the PircBot framework, it doesn’t do anything.

I’ve logged at the chat correctly but I don’t know why this doesn’t work; here’s the code:


public String Channel = ""; //Here goes the channel name

public MisterDiosBot(String name) {

public void onConnect() {
    sendMessage(Channel, "Bot connected");

public void onMessage(String channel, String sender, String login, String hostname, String message) {
public void onJoin(String Channel, String sender, String login, String hostname) {
    sendMessage(Canal, login+ " has joined the channel!");

public static Bot bot = new Bot("ElDiosDeLosBOTS");

public static void main(String[] args) {
    try {
        bot.connect("", 6667, "oauth");
    } catch (IOException e) {
    } catch (IrcException e) {
        System.out.println("Error connecting");


I don’t see any error. The IDE doesn’t show me any errors either, so I don’t know what it could be.

Is the channel name all in lowercase? It needs to be.

Yes, it’s in lowercase, the bot connects to the chat and i can send messages with the bot, but it doesn’t receive any message and it doesn’t call these methods :S

I don’t see the bot joining a channel anywhere in that code.

1 Like

Yes, at the Main class

The code you provided only connects to the server but doesn’t join any channel as 3ventic mentioned.
You have to do something like this after connecting (idk the exact call)


If you do this already then you should provide this code as well.


Omg thank both of you, i feel so stupid right now xD

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.