Changed the way bot checks for permissions