Example #1
0
        async Task TryGiveStarterRoles(ulong userId)
        {
            var dbUser = await DB.Users.GetAsync(userId);

            if (await DB.RoleInventory.HasAnyAsync(dbUser.UserId, StarterRoles))
            {
                return;
            }

            var roleId = StarterRoles.Random();

            await DB.RoleInventory.AddAsync(userId, roleId, "Starter role");

            var dbRole = await DB.Roles.GetAsync(roleId);

            await roleService.AddPermanentRoleAsync(userId, dbRole.RoleId);
        }