Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KinkCommands"/> class.
 /// </summary>
 /// <param name="kinks">The application's kink service.</param>
 /// <param name="feedback">The application's feedback service.</param>
 /// <param name="interactivity">The interactivity service.</param>
 public KinkCommands
 (
     KinkService kinks,
     UserFeedbackService feedback,
     InteractivityService interactivity
 )
 {
     _kinks         = kinks;
     _feedback      = feedback;
     _interactivity = interactivity;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KinkCommands"/> class.
 /// </summary>
 /// <param name="kinks">The application's kink service.</param>
 /// <param name="feedback">The application's feedback service.</param>
 /// <param name="dataService">The in-memory data service.</param>
 /// <param name="context">The command context.</param>
 public KinkCommands
 (
     KinkService kinks,
     FeedbackService feedback,
     InMemoryDataService <Snowflake, KinkWizard> dataService,
     ICommandContext context
 )
 {
     _kinks       = kinks;
     _feedback    = feedback;
     _dataService = dataService;
     _context     = context;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KinkWizard"/> class.
        /// </summary>
        /// <param name="database">A database context from the context pool.</param>
        /// <param name="context">The context.</param>
        /// <param name="feedback">The user feedback service.</param>
        /// <param name="kinkService">The kink service.</param>
        /// <param name="interactiveService">The interactive service.</param>
        public KinkWizard(GlobalInfoContext database, SocketCommandContext context, UserFeedbackService feedback, KinkService kinkService, InteractiveService interactiveService)
            : base(context, interactiveService)
        {
            this.Database = database;
            this.Feedback = feedback;
            this.Kinks    = kinkService;

            this.State = KinkWizardState.CategorySelection;

            var eb = new EmbedBuilder();

            eb.WithTitle("Kink Wizard");
            eb.WithDescription("Loading...");

            this.LoadingEmbed = eb.Build();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KinkWizardInteractions"/> class.
 /// </summary>
 /// <param name="kinks">The kink service.</param>
 /// <param name="dataService">The in-memory data service.</param>
 /// <param name="feedback">The user feedback service.</param>
 /// <param name="channelAPI">The channel API.</param>
 /// <param name="interactionAPI">The interaction API.</param>
 /// <param name="context">The interaction context.</param>
 public KinkWizardInteractions
 (
     KinkService kinks,
     InMemoryDataService <Snowflake, KinkWizard> dataService,
     FeedbackService feedback,
     IDiscordRestChannelAPI channelAPI,
     IDiscordRestInteractionAPI interactionAPI,
     InteractionContext context
 )
 {
     _kinks          = kinks;
     _feedback       = feedback;
     _interactionAPI = interactionAPI;
     _context        = context;
     _dataService    = dataService;
     _channelAPI     = channelAPI;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KinkWizard"/> class.
        /// </summary>
        /// <param name="feedback">The user feedback service.</param>
        /// <param name="kinkService">The kink service.</param>
        /// <param name="targetUser">The target user.</param>
        public KinkWizard
        (
            [NotNull] UserFeedbackService feedback,
            [NotNull] KinkService kinkService,
            [NotNull] IUser targetUser
        )
            : base(targetUser)
        {
            _feedback = feedback;
            _kinks    = kinkService;

            _targetUser = targetUser;

            _state = KinkWizardState.CategorySelection;

            var eb = new EmbedBuilder();

            eb.WithTitle("Kink Wizard");
            eb.WithDescription("Loading...");

            _loadingEmbed = eb.Build();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KinkCommands"/> class.
 /// </summary>
 /// <param name="database">A database context from the context pool.</param>
 /// <param name="kinks">The application's kink service.</param>
 /// <param name="feedback">The application's feedback service.</param>
 public KinkCommands(GlobalInfoContext database, KinkService kinks, UserFeedbackService feedback)
 {
     this.Database = database;
     this.Kinks    = kinks;
     this.Feedback = feedback;
 }
Ejemplo n.º 7
0
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        /// <summary>
        /// Initializes a new instance of the <see cref="AmbassadorClient"/> class.
        /// </summary>
        /// <param name="content">The content service.</param>
        public AmbassadorClient([NotNull] ContentService content)
        {
            this.Client = Type.GetType("Mono.Runtime") is null
                                ? new DiscordSocketClient()
                                : new DiscordSocketClient(new DiscordSocketConfig {
                WebSocketProvider = () => new WebSocketSharpProvider()
            });

            this.Client.Log += OnDiscordLogEvent;

            this.Commands      = new CommandService();
            this.Commands.Log += OnDiscordLogEvent;

            this.DiscordIntegration = new DiscordService();
            this.Content            = content;
            this.Commands           = new CommandService();
            this.OwnedEntities      = new OwnedEntityService();
            this.Roleplays          = new RoleplayService(this.Commands, this.OwnedEntities);
            this.Transformation     = new TransformationService(this.Content);

            this.Characters = new CharacterService(this.Commands, this.OwnedEntities, this.Content, this.Transformation);
            this.Characters.DiscoverPronounProviders();

            this.Feedback    = new UserFeedbackService();
            this.Dossiers    = new DossierService(this.Content);
            this.Interactive = new InteractiveService(this.Client);

            this.Lua   = new LuaService(this.Content);
            this.Kinks = new KinkService(this.Feedback);

            this.Permissions = new PermissionService();

            this.Privacy = new PrivacyService();

            this.Services = new ServiceCollection()
                            .AddSingleton(this.Client)
                            .AddSingleton(this.DiscordIntegration)
                            .AddSingleton(this.Content)
                            .AddSingleton(this.Commands)
                            .AddSingleton(this.Roleplays)
                            .AddSingleton(this.Characters)
                            .AddSingleton(this.Feedback)
                            .AddSingleton(this.Dossiers)
                            .AddSingleton(this.Interactive)
                            .AddSingleton(this.Transformation)
                            .AddSingleton(this.Lua)
                            .AddSingleton(this.Kinks)
                            .AddSingleton(this.Permissions)
                            .AddSingleton(this.Privacy)
                            .AddDbContextPool <GlobalInfoContext>(builder => GlobalInfoContext.ConfigureOptions(builder))
                            .BuildServiceProvider();

            this.Transformation = this.Transformation
                                  .WithDescriptionBuilder
                                  (
                ActivatorUtilities.CreateInstance <TransformationDescriptionBuilder>(this.Services)
                                  );

            this.Client.MessageReceived += OnMessageReceived;
            this.Client.MessageUpdated  += OnMessageUpdated;
        }