r-anime / misato

💬 Mod bot for the /r/anime Discord
MIT License
6 stars 7 forks source link

parseUser will crash trying to look up a user if not passed a guild #63

Open eritbh opened 3 years ago

eritbh commented 3 years ago

https://github.com/r-anime/discord-mod-bot/blob/master/bot/util/discord.js#L63 if guild is undefined the guild._client will break. Client should be passed to this function explicitly since guild is optional

this would be a case typescript would catch ._. time to convert everything to typescript

eritbh commented 2 years ago

This code actually was converted to Typescript in #215 but it doesn't address this issue because using _client bullshit at all is dumb and the client should be passed directly but I didn't want to break the API of the function in that PR. so this will still require its own fix