irc-bot/channel.ml

31 lines
614 B
OCaml
Raw Normal View History

2008-03-19 16:19:24 -06:00
module String_map =
Map.Make (struct
type t = string
let compare = compare
end)
2008-03-19 16:19:24 -06:00
type client = Iobuf.t * Irc.nuhost
2008-03-19 16:19:24 -06:00
type t = {name: string;
modes: string ref;
clients: client String_map.t}
2008-03-19 16:19:24 -06:00
let modes = "aimnqpsrtklb"
2008-03-19 16:19:24 -06:00
let channels = String_map.empty
let is_channel_name name =
match name.[0] with
| '#' | '&' | '!' | '+' ->
true
| _ ->
false
2008-03-19 16:19:24 -06:00
let has_mode chan mode =
String.contains !(chan.modes) mode
let handle_command iobuf (nick, username, hostname) cmd =
match (Command.as_tuple cmd) with
| _ ->
()