Example #1
0
        public MuteEvent GetMuteEvent(ulong userId, Contexts contexts, DiscordRequest request)
        {
            var reason    = _request.Arguments.FirstOrDefault(x => x.Name == "reason" || x.Name == "r")?.Value;
            var timeRange = request.GetFutureTimeRange(defaultTime: TimeSpan.FromHours(1));

            return(new MuteEvent(userId, timeRange, reason, contexts.Server.Id));
        }
Example #2
0
        public MuteEvent GetMuteEvent(ulong userId, Contexts contexts, DiscordRequest request)
        {
            var reason = this._request.Arguments.FirstOrDefault(x => x.Name == "reason" || x.Name == "r")?.Value;

            if (string.IsNullOrWhiteSpace(reason))
            {
                throw new NotEnoughArgumentsException();
            }
            var timeRange = request.GetFutureTimeRange(defaultTime: TimeSpan.FromHours(1));

            return(new MuteEvent(userId, timeRange, reason, contexts.Server.Id, contexts.Channel.Id));
        }