Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.88 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. import random
  4.  
  5.  
  6. class General(commands.Cog):
  7.     def __init__(self, client):
  8.         self.client = client
  9.  
  10.     # 8ball Command
  11.     @commands.command(aliases=['8ball'])
  12.     @commands.guild_only()
  13.     async def _8ball(self, ctx, *,question: commands.clean_content):
  14.         responses = ["As in Pz's Wingman, I see it so...",
  15.                     'Ask again later.',
  16.                     'Better not tell you now.',
  17.                     'Cannot predict now.',
  18.                     'Concentrate and ask again.',
  19.                     'Don’t count on it.',
  20.                     'It is certain.',
  21.                     'It is decidedly so.',
  22.                     'Most likely.',
  23.                     'My reply is no.',
  24.                     'My sources say no.',
  25.                     'Outlook not so good.',
  26.                     'Outlook good.',
  27.                     'Reply hazy, try again.',
  28.                     'Signs point to yes.',
  29.                     'Very doubtful.',
  30.                     'Without a doubt.',
  31.                     'Yes.',
  32.                     'Yes – definitely.',
  33.                     'You may rely on it.']
  34.         await ctx.channel.send(f'__Question:__ {question}\n__Answer:__ {random.choice(responses)}')
  35.  
  36.     @_8ball.error
  37.     async def _8ball_error(self, ctx, error):
  38.         if isinstance(error, commands.MissingRequiredArgument):
  39.             await ctx.channel.send(
  40.                 f"So    rry {ctx.author.mention}, but you did not use your braincells :brain: correctly. Try again with this format:\n"
  41.                 f"`pz!8ball <QUESTION>`")
  42.  
  43.     # Ping Command
  44.     @commands.command()
  45.     async def ping(self, ctx):
  46.         await ctx.channel.send(f'__*Pong!*__  :ping_pong: {round(self.client.latency * 1000)}ms')
  47.  
  48.  
  49. def setup(client):
  50.     client.add_cog(General(client))
  51.     print('"General Commands are loaded . . ."')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement