Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- import random
- class General(commands.Cog):
- def __init__(self, client):
- self.client = client
- # 8ball Command
- @commands.command(aliases=['8ball'])
- @commands.guild_only()
- async def _8ball(self, ctx, *,question: commands.clean_content):
- responses = ["As in Pz's Wingman, I see it so...",
- 'Ask again later.',
- 'Better not tell you now.',
- 'Cannot predict now.',
- 'Concentrate and ask again.',
- 'Don’t count on it.',
- 'It is certain.',
- 'It is decidedly so.',
- 'Most likely.',
- 'My reply is no.',
- 'My sources say no.',
- 'Outlook not so good.',
- 'Outlook good.',
- 'Reply hazy, try again.',
- 'Signs point to yes.',
- 'Very doubtful.',
- 'Without a doubt.',
- 'Yes.',
- 'Yes – definitely.',
- 'You may rely on it.']
- await ctx.channel.send(f'__Question:__ {question}\n__Answer:__ {random.choice(responses)}')
- @_8ball.error
- async def _8ball_error(self, ctx, error):
- if isinstance(error, commands.MissingRequiredArgument):
- await ctx.channel.send(
- f"So rry {ctx.author.mention}, but you did not use your braincells :brain: correctly. Try again with this format:\n"
- f"`pz!8ball <QUESTION>`")
- # Ping Command
- @commands.command()
- async def ping(self, ctx):
- await ctx.channel.send(f'__*Pong!*__ :ping_pong: {round(self.client.latency * 1000)}ms')
- def setup(client):
- client.add_cog(General(client))
- print('"General Commands are loaded . . ."')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement