-
Notifications
You must be signed in to change notification settings - Fork 1
/
simple.py
68 lines (60 loc) · 2.43 KB
/
simple.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import discord
from discord.ext import commands
import random
class SimpleCog(commands.Cog):
'''The base stuff'''
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['hi', 'howdy'])
async def hello(self, ctx):
"""Greet the bot."""
await ctx.send('Hello.')
@commands.command()
async def choose(self, ctx, *choices : str):
"""Chooses between multiple choices."""
random.seed()
if (len(choices) < 2):
await ctx.send("?")
else: await ctx.send(random.choice(choices))
# @commands.command(aliases=['is', 'are', 'am', 'does', 'will', 'can', 'do', 'could', 'did', 'should', 'would', 'was'])
# async def ask(self, ctx, *, message: str = None ):
# """Ask a Yes or No Question."""
# if message != None:
# random.seed()
# intensity = random.randint(1,20)
# if intensity == 1:
# await ctx.send("Absolutely not.")
# elif intensity < 10:
# await ctx.send("No.")
# elif intensity == 10:
# await ctx.send("Maybe.")
# elif intensity < 20:
# await ctx.send("Yes.")
# elif intensity == 20:
# await ctx.send("Definitely.")
# else: await ctx.send("Go fuck yourself.")
# else: await ctx.send("?")
@commands.command()
async def roll(self, ctx, *, message: str = None):
"""Shoot dice. Acceptable format is NdX. Where N is number of dice and X is how many sides."""
if message != None:
if message.index('d') >= 0:
nums = message.split('d')
try:
dice = int(nums[0])
sides = int(nums[1])
except:
await ctx.send("?")
else:
if dice and sides > 0:
response = ""
for x in range(dice):
random.seed()
response += "%s, " % random.randint(1, sides)
await ctx.send(response[:-2])
else: await ctx.send("?")
@commands.command(aliases=["diss", "disrespect"])
async def trash_talk(self, ctx, *, message: str = None ):
await ctx.send("The test results came back from the hospital.\nYou are a stage five dumbass.")
async def setup(bot):
await bot.add_cog(SimpleCog(bot))