title: How do I check if a user has a role in discord.py?
body: <p>I'm trying to make a command only accessible to people with an admin role, but all attempts I've made to check for it have not worked. I am using discord.py in the pyCharm editor. All help would be appreciated, I am a beginner.</p>
  <pre><code>if message.content.startswith('!gen'):
      import random
      num = random.randint(1, 100)
      if num &lt; 50:
          await message.channel.send(str(num)+' was generated, so you get x.')
      if num &gt; 50:
          await message.channel.send(str(num)+' was generated, so you get y.')
  </code></pre>