Thanks! the problem now is that I don’t understand how to do that in java using pircbot.
also Group Chat. Someone in the reddit thread gave me ‘199.9.253.119:6667’. Is that what I’m supposed to connect to instead of irc.twitch.tv when i setup?
oof. they sure do make this simple. Funny how /host and everything else works just fine.
so if I try to connect my bot to both connections it tells me im already connected to another. How do i separate a bot into two connections using the same username? Do i create a new bot object with a different name?
public ChatRaids() {
this.setName("twitchraidstwitch");
}
public static void main(String[] args) throws Exception {
ChatRaids bot = new ChatRaids();
bot.setVerbose(true);
ChatRaids whisperBot = new ChatRaids();
whisperBot .setVerbose(true);
bot.connect("irc.twitch.tv", 6667, "oauth:0XXXXXXXXXXX");
whisperBot .connect("199.9.253.119", 6667, "oauth:XXXXXXXXXXXXXXXX");
bot.joinChannel("#twitchraidstwitch");
}
public class ChatRaids extends PircBot{
boolean initialize = true;
public ChatRaids() {
this.setName("twitchraidstwitch");
}
public static void main(String[] args) throws Exception {
ChatRaids bot = new ChatRaids();
bot.setVerbose(true);
ChatRaids wBot = new ChatRaids();
wBot.setVerbose(true);
bot.connect("irc.twitch.tv", 6667, "oauth:XXXXXXXXXXX");
wBot.connect("199.9.253.119", 6667, "oauth:XXXXXXXXXXXX");
bot.joinChannel("#twitchraidstwitch");
}
public void capReq(){
sendRawLine("CAP REQ :twitch.tv/membership\r\n");
sendRawLine("CAP REQ :twitch.tv/tags\r\n");
sendRawLine("CAP REQ :twitch.tv/commands\r\n");
}
public void onMessage(String channel, String sender, String login, String hostname, String message) {
if(initialize){
capReq();
initialize=false;
sendMessage("#twitchraidstwitch", "/w Murderouskirk Hi "+host+"! Test msg.");
}
}
edit*
Looks like my commands break when I capReq(); too.
1452080991241 :murderouskirk!murderouskirk@murderouskirk.tmi.twitch.tv PRIVMSG #twitchraidstwitch :!rank
turns into something much longer and it fails to react accordingly.
Seems like I need to totally differentiate the wBot in order to accomplish this somehow… another class maybe?
Would it be more straightforward to just learn how to send a message?
also I can’t reply anymore today and my alt account gets flagged so…
I’m going to do some research. I think I just made a basic java rookie mistake by putting everything in one long class. I think I’m failing to differentiate my objects properly. Hopefully I can figure out how to separate this.
One thing to note is that Pircbot does not support tags unless you’ve added support for it already. It will likely throw and exception anytime a message is received with tags included.
I had to fix my basic java so make sure I had a seperate bot object, then I did this.
WhisperBot wBot = new WhisperBot();
wBot.setVerbose(true);
wBot.connect("199.9.253.119", 6667, "oauth:MYAUTH");
wBot.joinChannel("#199.9.253.119");
wBot.sendRawLineViaQueue("CAP REQ :twitch.tv/commands");
wBot.sendRawLineViaQueue("PRIVMSG #jtv :/w murderouskirk This is an example PM");
So I put the above in a static void in its own class, then call it from my main class and pass through my msg every time i need to whisper. It seems like it opens up a new bot object every time it’s called (which makes sense with how it’s coded) but it does the job since I’m only whispering users once each. Just for clarity sake if I whispered the same user a couple times it would look normal on their end, and when I send a message back it would show in console X times for each msg sent.
But that’s something I can sort out later just my cleaning up my basic code theory more.
I haven’t been able to process incoming whispers yet but I see them in console so I’m sure I can get it working later if I need it in the future.
Thanks for all the help guys, really appreciate it.