private async Task _discord_JoinedGuild(SocketGuild arg) { var guild = await _guildManager.GetGuildById(arg.Id); if (guild == null) { await _guildManager.CreateGuild(new Guild { GuildId = Cryptography.Encrypt(arg.Id.ToString()), OwnerId = Cryptography.Encrypt(arg.OwnerId.ToString()), CreatedDate = DateTime.UtcNow }); } var guildConfiguration = await _guildManager.GetGuildConfigurationByGuildId(arg.Id); if (guildConfiguration == null) { await _guildManager.CreateGuildConfiguration(new GuildConfiguration { GuildId = Cryptography.Encrypt(arg.Id.ToString()), LanguageCode = "en-US" }); } var defaultGroup = await _groupManager.GetGuildGroupByGuildIdAndName(arg.Id, "Default"); if (defaultGroup == null) { await _groupManager.CreateGuildGroup(new GuildGroup { GuildId = Cryptography.Encrypt(arg.Id.ToString()), Name = "Default" }); } }