Advertisement
LinkVIII

runners

Jul 29th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 KB | None | 0 0
  1. package run;
  2. import bot.Linksbutt;
  3.  
  4. public class TestOnFreenode {
  5.  
  6.     public static void main(String[] args) throws Exception {
  7.         Linksbutt bot = new Linksbutt();
  8.         bot.setVerbose(true);
  9.         // easy place to test
  10.         bot.connect("irc.freenode.net");
  11.         bot.joinChannel("#pircbot");
  12.     }
  13. }
  14.  
  15. package run;
  16. import bot.Linksbutt;
  17. import java.util.Scanner;
  18.  
  19. public class TwitchChoseChannel {
  20.  
  21.     @SuppressWarnings("resource")
  22.     public static void main(String[] args) {
  23.         Linksbutt bot = new Linksbutt();
  24.         // Enable debugging output.
  25.         bot.setVerbose(true);
  26.         // Connect to the IRC server. get password at
  27.         // http://www.twitchapps.com/tmi/
  28.         try {
  29.             bot.connect("irc.twitch.tv", 6667,
  30.                     "oauth:xxxxxxxxxx");
  31.         } catch (Exception e) {
  32.             System.out.println("fail\n" + e.getLocalizedMessage());
  33.         }
  34.         System.out.print("Channel: ");
  35.         Scanner s = new Scanner(System.in);
  36.         String chan = s.next();
  37.         if (!chan.startsWith("#"))
  38.             chan = "#" + chan;
  39.         bot.joinChannel(chan);
  40.     }
  41. }
  42.  
  43. package run;
  44. import bot.Linksbutt;
  45.  
  46. public class TwitchHardCoded {
  47.    
  48.     private static String channel = "#linkviii";
  49.     public static void main(String[] args) {
  50.         Linksbutt bot = new Linksbutt();
  51.         bot.setVerbose(true);
  52.         try {
  53.             bot.connect("irc.twitch.tv", 6667,
  54.                     "oauth:xxxxxxxxx");
  55.         } catch (Exception e) {
  56.             System.out.println("fail\n" + e.getLocalizedMessage());
  57.         }
  58.         bot.joinChannel(channel);
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement