Switch /decide to return an embed
This commit is contained in:
parent
8aa9552b4e
commit
e95708647c
@ -17,18 +17,30 @@ class Cheeky(commands.Cog):
|
|||||||
description="Separate your choices with the word 'or', or dont to get a yes or no response.",
|
description="Separate your choices with the word 'or', or dont to get a yes or no response.",
|
||||||
)
|
)
|
||||||
@option(
|
@option(
|
||||||
name="input_string",
|
name="question",
|
||||||
required=True,
|
required=True,
|
||||||
description="Separate your choices with 'or', or enter a singular choice to get a yes/no answer.",
|
description="Separate your choices with 'or', or enter a singular choice to get a yes/no answer.",
|
||||||
)
|
)
|
||||||
async def decide(self, ctx, input_string):
|
async def decide(self, ctx, question):
|
||||||
import random
|
import random
|
||||||
|
|
||||||
choices = input_string.split(" or ")
|
choices = question.split(" or ")
|
||||||
if len(choices) > 1:
|
if len(choices) > 1:
|
||||||
await ctx.respond(random.choice(choices))
|
embed = discord.Embed(
|
||||||
|
description=random.choice(choices),
|
||||||
|
color=discord.Color.green(),
|
||||||
|
type="rich",
|
||||||
|
)
|
||||||
|
embed.set_author(name="You asked me: %s" % question)
|
||||||
|
await ctx.respond(embed=embed)
|
||||||
else:
|
else:
|
||||||
await ctx.respond(random.choice(["yes", "no"]))
|
embed = discord.Embed(
|
||||||
|
description=random.choice(["yes", "no"]),
|
||||||
|
color=discord.Color.green(),
|
||||||
|
type="rich",
|
||||||
|
)
|
||||||
|
embed.set_author(name="You asked me: %s" % question)
|
||||||
|
await ctx.respond(embed=embed)
|
||||||
|
|
||||||
@commands.command(name="coom", pass_context=True)
|
@commands.command(name="coom", pass_context=True)
|
||||||
async def coom(self, ctx: commands.Context, id=None):
|
async def coom(self, ctx: commands.Context, id=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user