public ShortenURL(Pluggis pluggis, string[] messageLine, Channel channel, String fromNick) : base(pluggis, messageLine, channel) { longURL = messageLine[1]; this.fromNick = fromNick; Handler(); }
protected override void OnJoin(Channel channel, string from) { //Ignore if user already sent a message prior to the JOIN event. if (_userDatabase.ContainsUser(from)) return; PrepareWelcomeMessage(from); _statistics.UpdateOnJoin(from); }
public void AdminList(Channel channel, string nick, string admin) { if (!IsAdmin(nick)) { return; } Bot.SendMessage(SendType.Message, channel.Name, admins.Count.ToString()); }
protected override void OnMessage(Channel channel, IrcUser from, string message) { //Due to Twitch architecture, a user can send a message before a JOIN. if (!_userDatabase.ContainsUser(from.Nick)) OnJoin(channel, from.Nick); SendLastVisited(from.Nick); _statistics.UpdateOnMessage(from.Nick, message); }
private static void UserTick(object state) { Meebey.SmartIrc4net.Channel chan = _irc.GetChannel(Settings.Channel); foreach (Meebey.SmartIrc4net.ChannelUser user in chan.Users.Values) { UserManager.UpdateUser(user.Nick, Settings.ExpPerGrant, Settings.PointsPerGrant); } _timer.Change(TimeSpan.FromMinutes(Settings.MinutesBetweenGranting), TimeSpan.FromMilliseconds(-1)); }
public ActionHandler(Pluggis pluggis, string[] messageLine, Channel channel) { this.pluggis = pluggis; this.messageLine = messageLine; this.channel = channel; if (messageLine != null) { length = messageLine.Length; } }
public void AdminDel(Channel channel, string nick, string admin) { if (!IsAdmin(nick)) { return; } if (Delete(admin)) { Bot.SendMessage(SendType.Message, channel.Name, string.Format("removed {0} from the admin list", admin)); } else { Bot.SendMessage(SendType.Message, channel.Name, string.Format("no such admin {0}", admin)); } }
public void AdminAdd(Channel channel, string nick, string admin) { if (!IsAdmin(nick)) { return; } if (Add(admin)) { Bot.SendMessage(SendType.Message, channel.Name, string.Format("added {0} to admins", admin)); } else { Bot.SendMessage(SendType.Message, channel.Name, string.Format("{0} is already an admin", admin)); } }
protected override void OnQuit(Channel channel, string from) { //Treat the same as parts. OnPart(channel, from); }
//Part and Quit don't work properly on Twitch protected override void OnPart(Channel channel, string from) { _userDatabase.RemoveUser(from); }
public Time(Pluggis pluggis, Channel channel) : base(pluggis, channel) { Handler(); }
void OnChannelActiveSynced(object sender, IrcEventArgs e) { channel = client.GetChannel(e.Data.Channel); AddNotification("{0} users online".F(channel.Users.Count)); connectionStatus = ChatConnectionStatus.Joined; foreach (DictionaryEntry user in channel.Users) { var u = (ChannelUser)user.Value; Game.RunAfterTick(() => Users.Add(u.Nick, new ChatUser(u.Nick, u.IsOp, u.IsVoice))); } }
public DiceRoll(Pluggis pluggis, string[] messageLine, Channel channel) : base(pluggis, messageLine, channel) { rand = new Random(); Handler(); }
public ActionHandler(Pluggis pluggis, Channel channel) : this(pluggis, null, channel) { }
public VersionInfo(Pluggis pluggis, Channel channel) : base(pluggis, channel) { Handler(); }
protected override void OnAction(Channel channel, IrcUser from, string message) { //Treat the same as messages. OnMessage(channel, from, message); }
/// <summary> /// Event handler for join messages /// </summary> /// <param name="ircdata">Message data containing join information</param> private void _Event_JOIN(IrcMessageData ircdata) { string who = ircdata.Nick; string channelname = ircdata.Channel; if (IsMe(who)) { _JoinedChannels.Add(channelname); } if (ActiveChannelSyncing) { Channel channel; if (IsMe(who)) { // we joined the channel #if LOG4NET Logger.ChannelSyncing.Debug("joining channel: "+channelname); #endif if (SupportNonRfc) { channel = new NonRfcChannel(channelname); } else { channel = new Channel(channelname); } _Channels.Add(channelname, channel); // request channel mode RfcMode(channelname); // request wholist RfcWho(channelname); // request banlist Ban(channelname); } else { // someone else joined the channel // request the who data RfcWho(who); } #if LOG4NET Logger.ChannelSyncing.Debug(who+" joins channel: "+channelname); #endif channel = GetChannel(channelname); IrcUser ircuser = GetIrcUser(who); if (ircuser == null) { ircuser = new IrcUser(who, this); ircuser.Ident = ircdata.Ident; ircuser.Host = ircdata.Host; _IrcUsers.Add(who, ircuser); } ChannelUser channeluser; if (SupportNonRfc) { channeluser = new NonRfcChannelUser(channelname, ircuser); } else { channeluser = new ChannelUser(channelname, ircuser); } channel.UnsafeUsers.Add(who, channeluser); } if (OnJoin != null) { OnJoin(this, new JoinEventArgs(ircdata, channelname, who)); } }
public ParseForURL(Pluggis pluggis, string[] messageLine, Channel channel) : base(pluggis, messageLine, channel) { Handler(); }