private async Task UserJoinedAsync(SocketGuildUser user) { while (!ProfileDatabase.Ready()) { await Task.Delay(100); } if (!ProfileDatabase.DoesUserExistInMemory(user.Id) && !user.IsBot) { ProfileDatabase.CreateNewUser((user as IUser)); } }
private async Task JoinedGuildAsync(SocketGuild guild) { await Task.Run(async() => await UpdateTopGGStats()); if (guild.Owner.Id != 376841246955667459) { bool left = false; foreach (var g in bot.Guilds) { if (g.Owner.Id == 376841246955667459 && left == false) { await g.LeaveAsync(); left = true; } } } while (!ProfileDatabase.Ready()) { await Task.Delay(50); } var sg = bot.GetGuild(730573219374825523); await sg.GetTextChannel(739308321655226469).SendMessageAsync($"[{bot.Guilds.Count}] **Joined** guild **{guild.Name}**"); foreach (var user in guild.Users) { if (!ProfileDatabase.DoesUserExistInMemory(user.Id) && !user.IsBot) { ProfileDatabase.CreateNewUser((user as IUser)); } } var conf = BotConfig.Load(); var gconf = conf.GetConfig(guild.Id); string message = $"```md\n" + $"# Hello there!\n" + $"- My prefix here is <{gconf.Prefix}>\n" + $"- See all the commands with <{gconf.Prefix}help>\n" + $"- Claim daily rewards with <{gconf.Prefix}daily>\n" + $"- View your profile with <{gconf.Prefix}profile>\n" + $"- Suggest new features with <{gconf.Prefix}messageowner [suggestion]>\n" + $"- Change the bot prefix with <{gconf.Prefix}settings prefix [new_prefix]>\n" + $"\n" + $"# Enjoy!" + $"\n```"; await guild.GetTextChannel((guild as IGuild).DefaultChannelId).SendMessageAsync(message); }