static public async Task LinkScoresaberWithDiscord(DiscordSocketClient discordSocketClient, SocketMessage message) { var r = new RoleAssignment(discordSocketClient); if (r.CheckIfDiscordIdIsLinked(message.Author.Id.ToString())) { await message.Channel.SendMessageAsync("", false, EmbedBuilderExtension.NullEmbed("Pog", $"Your Discord ID is already linked with your scoresaber, No worries {message.Author.Username}. If you want to unlink, type !bs unlink.").Build()); await message.Channel.SendMessageAsync("Your Discord ID is already linked with your scoresaber, No worries " + message.Author.Username); return; } else { var ScoresaberId = message.Content.Substring(9); ScoresaberId = Regex.Replace(ScoresaberId, "[^0-9]", ""); if (!ValidationExtension.IsDigitsOnly(ScoresaberId)) { await message.Channel.SendMessageAsync("Scoresaber ID is wrong"); return; } if (await ValidationExtension.IsDutch(ScoresaberId)) { var guildChannel = message.Channel as SocketGuildChannel; if (guildChannel.Guild.Id != 505485680344956928) { message.Channel.SendMessageAsync("It seems that you are Dutch and trying to link your account outside the Dutch Discord. A Dutch request needs to be validated. Consider joining the Dutch Beat Saber Discord. (https://discord.gg/cH7mTyq)"); } r.MakeRequest(message); } else { JsonExtension.InsertJsonData("../../../GlobalAccounts.txt", message.Author.Id.ToString(), ScoresaberId); await message.Channel.SendMessageAsync("", false, EmbedBuilderExtension.NullEmbed("Added user to the list", "Added " + message.Author.Id.ToString() + " with scoresaberID " + ScoresaberId + " to the global list", null, null).Build()); return; } } var moderationHelper = new GuildService(discordSocketClient, 505485680344956928); var user = message.Author; if (moderationHelper.UserHasRole(user, "Nieuwkomer")) { await moderationHelper.AddRole("Link my discord please", user); await moderationHelper.DeleteRole("Nieuwkomer", user); } }