public RiasModule(IServiceProvider serviceProvider) { RiasBot = serviceProvider.GetRequiredService <Rias>(); Credentials = serviceProvider.GetRequiredService <Credentials>(); Localization = serviceProvider.GetRequiredService <Localization>(); _interactivity = serviceProvider.GetRequiredService <InteractivityExtension>(); _scope = serviceProvider.CreateScope(); DbContext = _scope.ServiceProvider.GetRequiredService <RiasDbContext>(); }
public MuteContext(Rias riasBot, Snowflake guildId, Snowflake moderatorId, Snowflake userId, Snowflake channelId) { _riasBot = riasBot; Guild = riasBot.GetGuild(guildId); GuildId = guildId; Moderator = Guild?.GetMember(moderatorId); Member = Guild?.GetMember(userId); UserId = userId; SourceChannel = Guild?.GetTextChannel(channelId); SentByTimer = true; }
public RiasService(IServiceProvider serviceProvider) { RiasBot = serviceProvider.GetRequiredService <Rias>(); Credentials = serviceProvider.GetRequiredService <Credentials>(); Localization = serviceProvider.GetRequiredService <Localization>(); }