public void Mode(string target, string[] newModes, string[] newModeParameters) { if (target == null) { throw new ArgumentNullException(nameof(target)); } if (newModes == null) { throw new ArgumentNullException(nameof(newModes)); } if (newModeParameters == null) { throw new ArgumentNullException(nameof(newModeParameters)); } if (newModes.Length == 0) { throw new ArgumentException("newModes must not be empty.", nameof(newModes)); } if (newModeParameters.Length == 0) { throw new ArgumentException("newModeParameters must not be empty.", nameof(newModeParameters)); } if (newModes.Length != newModeParameters.Length) { throw new ArgumentException("newModes and newModeParameters must have the same size.", nameof(newModes)); } int maxModeChanges = MaxModeChanges; for (int i = 0; i < newModes.Length; i += maxModeChanges) { var newModeChunks = new List <string>(maxModeChanges); var newModeParameterChunks = new List <string>(maxModeChanges); for (int j = 0; j < maxModeChanges; j++) { if (i + j >= newModes.Length) { break; } newModeChunks.Add(newModes[i + j]); newModeParameterChunks.Add(newModeParameters[i + j]); } WriteLine(Rfc2812.Mode(target, newModeChunks.ToArray(), newModeParameterChunks.ToArray())); } }
public void RfcMode(string target) => WriteLine(Rfc2812.Mode(target));
public void RfcMode(string target, Priority priority) => WriteLine(Rfc2812.Mode(target), priority);
/// <summary> /// Fetch a list of entries of a mask-format channel mode. /// </summary> /// <param name="modetype">The type of the mask-format mode (e.g. +b) to fetch.</param> /// <param name="channel">The channel whose mode to fetch.</param> /// <param name="priority">The priority with which the mode-setting message should be sent.</param> public void ListChannelMasks(string modetype, string channel, Priority priority) => WriteLine(Rfc2812.Mode(channel, modetype), priority);
/// <summary> /// Add or remove an entry to/from a mask-format channel mode. /// </summary> /// <param name="modetype">The type of the mask-format mode (e.g. +b) whose entries to modify.</param> /// <param name="channel">The channel whose mode to edit.</param> /// <param name="hostmask">The hostmask of the entry to add/remove.</param> public void ModifyChannelMasks(string modetype, string channel, string hostmask) => WriteLine(Rfc2812.Mode(channel, modetype + " " + hostmask));
public void Voice(string channel, string nickname) { this.WriteLine(Rfc2812.Mode(channel, "+v " + nickname)); }
/// <summary> /// Fetch a list of entries of a mask-format channel mode. /// </summary> /// <param name="modetype">The type of the mask-format mode (e.g. +b) to fetch.</param> /// <param name="channel">The channel whose mode to fetch.</param> public void ListChannelMasks(string modetype, string channel) => WriteLine(Rfc2812.Mode(channel, modetype));
public void Deop(string channel, string nickname, Priority priority) { this.WriteLine(Rfc2812.Mode(channel, "-o " + nickname), priority); }
public void Deop(string channel, string nickname) { this.WriteLine(Rfc2812.Mode(channel, "-o " + nickname)); }
public void Unban(string channel, string hostmask) { this.WriteLine(Rfc2812.Mode(channel, "-b " + hostmask)); }
public void RfcMode(string target) { this.WriteLine(Rfc2812.Mode(target)); }
public void Unban(string channel, string hostmask, Priority priority) { this.WriteLine(Rfc2812.Mode(channel, "-b " + hostmask), priority); }
public void Ban(string channel) { this.WriteLine(Rfc2812.Mode(channel, "+b")); }
public void Ban(string channel, Priority priority) { this.WriteLine(Rfc2812.Mode(channel, "+b"), priority); }
public void RfcMode(string target, string newmode, Priority priority) => WriteLine(Rfc2812.Mode(target, newmode), priority);
/// <summary> /// Give or take a user's privilege in a channel. /// </summary> /// <param name="modechg">The mode change (e.g. +o) to perform on the user.</param> /// <param name="channel">The channel in which to perform the privilege change.</param> /// <param name="nickname">The nickname of the user whose privilege is being changed.</param> public void ChangeChannelPrivilege(string modechg, string channel, string nickname) => WriteLine(Rfc2812.Mode(channel, modechg + " " + nickname));
public void RfcMode(string target, string newmode) => WriteLine(Rfc2812.Mode(target, newmode));
public void Voice(string channel, string nickname, Priority priority) { this.WriteLine(Rfc2812.Mode(channel, "+v " + nickname), priority); }