Skip to content

Instantly share code, notes, and snippets.

View blizzarddreams's full-sized avatar
❄️
arctic fox

Blizzard blizzarddreams

❄️
arctic fox
  • Kentucky
  • 23:20 (UTC -04:00)
View GitHub Profile
class Dog {
constructor(name) {
this.name = name;
}
bark() {
return `${this.name} goes bark!`;
}
}
channels = ["#test", "#world"]
main = do
conn <- connectTo (server bot) $ PortNumber $ fromIntegral $ 6667
hSetBuffering conn NoBuffering
write conn "USER" $ nick bot ++ " 8 * :" ++ nick bot
write conn "NICK" "haskelbottt"
write conn "JOIN" "#botwars" -- instead I want to loop through channels and pass it AND conn to `write`
listen conn
List<String> channels = new ArrayList<String>();
channels.add("#hello");
channels.add("#world");
for (String channel : channels) {
System.out.println(channel);
}
listen :: Handle -> IO ()
listen h = forever $ do
s <- hGetLine h
putStrLn s
where
forever a = do a; forever a
h <- connectTo server (PortNumber (fromIntegral port))
h <- connectTo server $ PortNumber $ show $ port
data Person = Person {Name :: String, Age :: Int}
anthony = Person "Anthony" 17
-- How do I get the value of Name from anthony
package ircscalabot
import javax.script.ScriptException
import java.io.{PrintWriter, ByteArrayOutputStream, PrintStream}
import org.json4s._
import org.json4s.native.JsonMethods._
import org.json4s.native.Serialization.write
import scala.collection.JavaConverters._
import java.io.*;
import java.net.Socket;
/**
* Created by Anthony on 12/21/2015.
*/
public class Bot {
public static void main(String[] args) throws Exception {
Socket socket = new Socket("irc.freenode.net", 6667);
package ircscalabot;
import java.io.*;
import java.net.Socket;
/**
* Created by Anthony on 12/19/2015.
*/
package ircscalabot
import javax.script.ScriptException
import java.io.{PrintWriter, ByteArrayOutputStream, PrintStream}
import org.json4s._
import org.json4s.native.JsonMethods._
import org.json4s.native.Serialization.write
import scala.tools.nsc.Settings