TypeError is sticking to an unrelated line
I am trying to recreate a Discord bot about catching stuff. Someone else already had most of the code, so all I need to do is adjust it from local hosting to online hosting. However, the function that actually “spawns” the stuff is not working, and always gives me the same error: