コード例 #1
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        public static Task <int> CreateMessageAsync(this ActionScheduler actionScheduler, string message)
        {
            message.ThrowIfNullOrEmpty(nameof(message));

            var action = new MessageCreator(message);

            return(actionScheduler.ScheduleActionAsync <int>(action));
        }
コード例 #2
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        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));
        }
コード例 #3
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        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));
        }
コード例 #4
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        public static Task <bool> DeleteMessageAsync(this ActionScheduler actionScheduler, int messageId)
        {
            var action = new MessageDeleter(messageId);

            return(actionScheduler.ScheduleActionAsync <bool>(action));
        }
コード例 #5
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        public static Task <bool> KickMuteUserAsync(this ActionScheduler actionScheduler, int userId)
        {
            var action = new UserKickMuter(userId);

            return(actionScheduler.ScheduleActionAsync <bool>(action));
        }
コード例 #6
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        public static Task ChangeUserAccessLevelAsync(this ActionScheduler actionScheduler, int userId, UserAccessLevel newLevel)
        {
            var action = new UserAccessLevelEditor(userId, newLevel);

            return(actionScheduler.ScheduleActionAsync <bool>(action));
        }
コード例 #7
0
ファイル: Extenions.cs プロジェクト: rjrudman/SharpExchange
        public static Task <bool> ToggleStarAsync(this ActionScheduler actionScheduler, int messageId)
        {
            var action = new MessageStarToggler(messageId);

            return(actionScheduler.ScheduleActionAsync <bool>(action));
        }