Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create 8ball command in discord.py

import discord, random
from discord.ext import commands

bot = commands.Bot(command_prefix='?')

@bot.event
def on_ready():
  print('Bot is online!')

@bot.command(aliases=['8ball'])
async def _8ball(ctx, *, q):
  responses = ['yes', 'no', 'maybe', '...', 'problably not', 'ok']
  await ctx.send(f'Question: {q}
 Answer: {random.choice(responses)}')

bot.token("your bot's token here")
 
PREVIOUS NEXT
Tagged: #create #command
ADD COMMENT
Topic
Name
2+9 =