Advertisement
Combreal

rollBot.py

Jan 18th, 2023
1,237
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 1 0
  1. #rollBot.py
  2. import os
  3. import random
  4. import discord
  5. from dotenv import load_dotenv
  6. from discord.ext import commands
  7.  
  8. load_dotenv()
  9. TOKEN = os.getenv('DISCORD_TOKEN')
  10.  
  11. intents = discord.Intents.default()
  12. intents.members = True
  13. intents.message_content = True
  14. bot = commands.Bot(command_prefix='/', intents=intents)
  15.  
  16. @bot.event
  17. async def on_ready():
  18.     print(f'{bot.user.name} has connected to Discord!')
  19.    
  20. @bot.command(name='roll')
  21. async def nine_nine(ctx):
  22.     await ctx.send(random.randint(1, 100))
  23.  
  24. bot.run(TOKEN)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement