public PaginatedMessageCallback(InteractiveService interactive, MummyContext sourceContext, PaginatedMessage pager, ICriterion <ReactionData> criterion = null)
 {
     Interactive = interactive;
     Context     = sourceContext;
     Criterion   = criterion ?? new EmptyCriterion <ReactionData>();
     _pager      = pager;
     pages       = _pager.Pages.Count;
 }
Пример #2
0
 public PaginatedMessageCallback(InteractiveService interactive,
                                 SocketCommandContext sourceContext,
                                 PaginatedMessage pager,
                                 ICriterion <SocketReaction> criterion = null)
 {
     Interactive = interactive;
     Context     = sourceContext;
     _criterion  = criterion ?? new EmptyCriterion <SocketReaction>();
     _pager      = pager;
     pages       = _pager.Pages.Count();
 }
Пример #3
0
 public DialogueBoxCallback(
     InteractiveService interactive,
     SocketCommandContext sourceContext,
     DialogueBox Dialogue,
     ICriterion <SocketReaction> criterion = null)
 {
     Interactive = interactive;
     Context     = sourceContext;
     Criterion   = criterion ?? new EmptyCriterion <SocketReaction>();
     _dialogue   = Dialogue;
 }
 public InlineReactionCallback(
     InteractiveService interactive,
     SocketCommandContext context,
     ReactionCallbackData data,
     ICriterion <SocketReaction> criterion = null)
 {
     _interactive = interactive;
     Context      = context;
     _data        = data;
     Criterion    = criterion ?? new EmptyCriterion <SocketReaction>();
     Timeout      = data.Timeout;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InlineReactionCallback"/> class.
 /// </summary>
 /// <param name="interactive">
 /// The interactive.
 /// </param>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <param name="data">
 /// The data.
 /// </param>
 /// <param name="criterion">
 /// The criterion.
 /// </param>
 public InlineReactionCallback(
     InteractiveService interactive,
     SocketCommandContext context,
     ReactionCallbackData data,
     ICriterion <SocketReaction> criterion = null)
 {
     this.interactive = interactive;
     Context          = context;
     this.data        = data;
     Criterion        = criterion ?? new EmptyCriterion <SocketReaction>();
     Timeout          = data.Timeout ?? TimeSpan.FromSeconds(30);
 }
 public PaginatedMessageCallback(InteractiveService interactive,
                                 SocketCommandContext sourceContext,
                                 PaginatedMessage pager,
                                 ICriterion <SocketReaction> criterion = null)
 {
     Interactive = interactive;
     Context     = sourceContext;
     _criterion  = criterion ?? new EmptyCriterion <SocketReaction>();
     _pager      = pager;
     pages       = _pager.Pages.Count();
     if (_pager.Pages is IEnumerable <EmbedFieldBuilder> )
     {
         pages = ((_pager.Pages.Count() - 1) / options.FieldsPerPage) + 1;
     }
 }
Пример #7
0
        public PaginatedMessageCallback(InteractiveService interactive,
                                        SocketCommandContext sourceContext,
                                        PaginatedMessage pager,
                                        ICriterion <SocketReaction> criterion = null)
        {
            Interactive = interactive;
            Context     = sourceContext;
            Criterion   = criterion ?? new EmptyCriterion <SocketReaction>();
            _pager      = pager;

            pages = _pager.PageCount;
            if (pages == -1)
            {
                try
                {
                    pages = _pager.Fields.Max(x => x.Pages.Count());
                } catch { }
                try
                {
                    pages = pages > _pager.Pages.Count() ? pages : _pager.Pages.Count();
                } catch { }
            }
            _pager.PageCount = pages;
        }