示例#1
0
 /// <summary>
 /// Constructs the <see cref="HelpService"/>.
 /// </summary>
 public HelpService(DiscordBotServiceContainer services,
                    ConfigParserService configParser,
                    ReactionService reactions)
     : base(services)
 {
     this.configParser = configParser;
     this.reactions    = reactions;
 }
示例#2
0
 public EnigmaModule(DiscordBotServiceContainer services,
                     EnigmaService enigma,
                     ConfigParserService configParser)
     : base(services)
 {
     this.enigma       = enigma;
     this.configParser = configParser;
 }
示例#3
0
 public EnigmaService(DiscordBotServiceContainer services,
                      ConfigParserService configParser) : base(services)
 {
     letterSet             = LetterSetIO.Read(LetterSetFile);
     steckering            = PlugboardIO.Read(letterSet.Count, PlugboardFile);
     rotorKeys             = RotorIO.Read(RotorKeysFile);
     this.configParser     = configParser;
     Client.ReactionAdded += OnReactionAddedAsync;
 }
示例#4
0
 public HelpModule(DiscordBotServiceContainer services,
                   ReactionService reactions,
                   HelpService help,
                   ConfigParserService configParser)
     : base(services)
 {
     this.reactions    = reactions;
     this.help         = help;
     this.configParser = configParser;
 }
 public ConfigParserService(DiscordBotServiceContainer services) : base(services)
 {
     AddToken(UsernameToken, () => Username);
     AddToken(NicknameToken, () => Nickname);
     AddToken(UserIdToken, () => UserId);
     AddToken(OwnerUsernameToken, () => OwnerUsername);
     AddToken(OwnerUserIdToken, () => OwnerUserId);
     AddToken(VersionToken, () => Version);
     AddToken(BuildDateToken, () => BuildDate);
     AddColor(EmbedColorName, () => EmbedColor);
 }
示例#6
0
        /// <summary>
        /// Constructs the <see cref="StatusRotationService"/>.
        /// </summary>
        public StatusRotationService(DiscordBotServiceContainer services,
                                     Random rng)
            : base(services)
        {
            this.rng = rng;

            Reload();
            DiscordBot.ConfigReloaded += OnReloadAsync;

            Client.Connected += OnConnected;
        }
示例#7
0
 /// <summary>
 /// Constructs the <see cref="StartupService"/>
 /// </summary>
 public StartupService(DiscordBotServiceContainer services,
                       IConfigurationRoot config,
                       DiscordSocketClient client,
                       CommandServiceEx commands,
                       IDiscordBot discordBot)
 {
     Services   = services;
     Client     = client;
     Commands   = commands;
     DiscordBot = discordBot;
 }
 /// <summary>
 /// Constructs the <see cref="DiscordBotCommandContext"/>.
 /// </summary>
 /// <param name="services">The Discord bot service container.</param>
 /// <param name="client">The underlying client.</param>
 /// <param name="msg">The underlying message.</param>
 public DiscordBotCommandContext(DiscordBotServiceContainer services, DiscordSocketClient client,
                                 SocketUserMessage msg)
     : base(client, msg)
 {
     Services = services;
     if (!Contexting.IsDbLockableContext(this) && !Contexting.IsDbManagerContext(this))
     {
         return;
     }
     using (var db = Contexting.GetCommandContextDb()) {
         LockContext = Contexting.FindDbLockableContextAsync(db, this, false).GetAwaiter().GetResult();
         if (LockContext is IDbManagerContext manageContext)
         {
             ManageContext = manageContext;
         }
         else
         {
             ManageContext = Contexting.FindDbManagerContextAsync(db, this, false).GetAwaiter().GetResult();
         }
     }
 }
 /// <summary>
 /// Constructs the <see cref="SuperuserModule"/>.
 /// </summary>
 public SuperuserModule(DiscordBotServiceContainer services) : base(services)
 {
 }
示例#10
0
 /// <summary>
 /// Constructs the <see cref="LogGroup"/>.
 /// </summary>
 public LogGroup(DiscordBotServiceContainer services) : base(services)
 {
 }
示例#11
0
 public HelpGroup(DiscordBotServiceContainer services,
                  HelpService help)
     : base(services)
 {
     this.help = help;
 }
示例#12
0
 /// <summary>
 /// Constructs the <see cref="ReactionService"/>.
 /// </summary>
 public ReactionService(DiscordBotServiceContainer services) : base(services)
 {
     Client.Connected += OnFirstConnectedAsync;
 }
		/// <summary>
		/// Constructs the <see cref="CommandHandlerService"/>.
		/// </summary>
		public CommandHandlerService(DiscordBotServiceContainer services) : base(services) {
			Client.MessageReceived += OnMessageReceived;
		}
示例#14
0
 /// <summary>
 /// Constructs the <see cref="ResultHandlerService"/>.
 /// </summary>
 public ResultHandlerService(DiscordBotServiceContainer services) : base(services)
 {
     Commands.CommandExecuted += OnCommandResultAsync;
 }
 /// <summary>
 /// Constructs the <see cref="DiscordBotUserWaitContext"/>.
 /// </summary>
 /// <param name="services">The Discord bot service container.</param>
 /// <param name="client">The underlying client.</param>
 /// <param name="msg">The underlying message.</param>
 public DiscordBotUserWaitContext(DiscordBotServiceContainer services, DiscordSocketClient client,
                                  SocketUserMessage msg, string name, TimeSpan duration)
     : base(client, msg, services.Commands, name, duration)
 {
     Services = services;
 }
 /// <summary>
 /// Constructs the <see cref="DiscordBotUserWaitContext"/>.
 /// </summary>
 /// <param name="context">The underlying command context.</param>
 public DiscordBotUserWaitContext(DiscordBotCommandContext context, string name, TimeSpan duration)
     : base(context, context.Services.Commands, name, duration)
 {
     Services = context.Services;
 }
示例#17
0
 public EnigmaReactions(DiscordBotServiceContainer services) : base(services)
 {
 }
 public DefaultContextingService(DiscordBotServiceContainer services) : base(services)
 {
 }
示例#19
0
 /// <summary>
 /// Constructs the <see cref="DiscordBotService"/>.
 /// </summary>
 /// <param name="services"></param>
 public DiscordBotService(DiscordBotServiceContainer services)
 {
     Services = services;
 }