When attempted to load a player, we check if the entry includes a discord_id.
If it does this indicates the player is on discord, so we attempt to boot a DiscordPlayer class which calls the Discord.GuildMember class.
If the member is not on the server, as is true with this member due to their leaving the server, the bot errors.
Event.ready() Failed loading player [ 1002536069 ] to cache! Error: Database.DiscordPlayer.load(); Error! DiscordAPIError: Unknown Member
at DiscordPlayer.loadDiscord (C:\Users\scion\OneDrive\Desktop\bots_\bot_src\G-C-A_V2\src\Database\Schemas\Player\DiscordPlayer.js:34:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async loadMembers (C:\Users\scion\OneDrive\Desktop\bots_\bot_src\G-C-A_V2\src\Discord\Events\Discord\ready.js:184:26)
at async module.exports (C:\Users\scion\OneDrive\Desktop\bots_\bot_src\G-C-A_V2\src\Discord\Events\Discord\ready.js:32:5)
To Reproduce
Steps to reproduce the behavior:
Have a member join the clan and server.
Verify the member.
Have the member leave the server.
Re-attempt to load the player via new DiscordPlayer(), or restart the bot.
Expected behavior
The bot loading the player to cache regardless of them being on the server or not.
A Discord verified member should default to the Database.Player class if they are not on discord.
Describe the bug
To Reproduce
Expected behavior
Screenshots
Additional context