Exemple #1
0
        public EspeonBot(
            ILogger <EspeonBot> logger,
            IOptions <Discord> discordOptions,
            EspeonPrefixProvider prefixProvider,
            DiscordBotConfiguration configuration)
            : base(TokenType.Bot, discordOptions.Value.Token, prefixProvider, configuration)
        {
            this._logger = logger;
            this._localisationService = this.GetRequiredService <LocalisationService>();
            Ready                  += OnReadyAsync;
            Ready                  += OnFirstReadyAsync;
            JoinedGuild            += OnGuildJoined;
            LeftGuild              += OnGuildLeft;
            CommandExecuted        += OnCommandExecuted;
            CommandExecutionFailed += OnCommandExecutionFailed;
            this.GetRequiredService <EspeonScheduler>().OnError += OnSchedulerError;

            AddTypeParser(new UserReminderTypeParser());
            AddTypeParser(new IMessageTypeParser());
            AddTypeParser(new ModuleTypeParser());
            AddTypeParser(new CommandTypeParser());
            AddTypeParser(new IMemberTypeParser());
            AddModules(Assembly.GetEntryAssembly(), type => type != typeof(TagModule));
            AddExtensionAsync(new InteractivityExtension());
        }
Exemple #2
0
        public async Task DefaultAsync()
        {
            await LocalisationService.UpdateLocalisationAsync(DbContext, Context.Guild.Id, Context.Member.Id, Language.Default);

            await ReplyAsync(LOCALISATION_SET, "default");
        }
Exemple #3
0
        public async Task OwoAsync()
        {
            await LocalisationService.UpdateLocalisationAsync(DbContext, Context.Guild.Id, Context.Member.Id, Language.Owo);

            await ReplyAsync(LOCALISATION_SET, "owo");
        }