Exemplo n.º 1
0
        public async Task EnablePlugin(IGuild guild, ModuleInfo moduleInfo)
        {
            await _simpleCacheImplementation.InvalidateValueAsync($"guildPluginsCache-{guild.Id}");

            NpgsqlConnection guildService = (NpgsqlConnection)_database.GetDbConnection("HeroBot.Core");
            var r = this.GetAssemblyEntityByModule(moduleInfo).Assembly.GetName().Name.SanitizAssembly();
            await guildService.ExecuteAsync(InsertPlugin, new
            {
                guild  = (long)guild.Id,
                plugin = r
            });
        }
Exemplo n.º 2
0
        internal async Task UpdateUser(RPUser rPUser)
        {
            using var connection = _database.GetDbConnection();
            await _cache.InvalidateValueAsync($"rp-user-{rPUser.UserId}");

            await connection.ExecuteAsync(UpdateUserSql, rPUser);
        }