public static Task <int> CreateMessageAsync(this ActionScheduler actionScheduler, string message) { message.ThrowIfNullOrEmpty(nameof(message)); var action = new MessageCreator(message); return(actionScheduler.ScheduleActionAsync <int>(action)); }
public static Task <bool> EditMessageAsync(this ActionScheduler actionScheduler, int messageId, string newText) { newText.ThrowIfNullOrEmpty(nameof(newText)); var action = new MessageEditor(messageId, newText); return(actionScheduler.ScheduleActionAsync <bool>(action)); }
public static Task <bool> TimeoutRoomAsync(this ActionScheduler actionScheduler, int durationSeconds, string reason) { if (durationSeconds < 5) { throw new ArgumentOutOfRangeException(nameof(durationSeconds), "Must be more than or equal to 5."); } reason.ThrowIfNullOrEmpty(nameof(reason)); var action = new RoomTimeout(durationSeconds, reason); return(actionScheduler.ScheduleActionAsync <bool>(action)); }
public static Task <bool> DeleteMessageAsync(this ActionScheduler actionScheduler, int messageId) { var action = new MessageDeleter(messageId); return(actionScheduler.ScheduleActionAsync <bool>(action)); }
public static Task <bool> KickMuteUserAsync(this ActionScheduler actionScheduler, int userId) { var action = new UserKickMuter(userId); return(actionScheduler.ScheduleActionAsync <bool>(action)); }
public static Task ChangeUserAccessLevelAsync(this ActionScheduler actionScheduler, int userId, UserAccessLevel newLevel) { var action = new UserAccessLevelEditor(userId, newLevel); return(actionScheduler.ScheduleActionAsync <bool>(action)); }
public static Task <bool> ToggleStarAsync(this ActionScheduler actionScheduler, int messageId) { var action = new MessageStarToggler(messageId); return(actionScheduler.ScheduleActionAsync <bool>(action)); }