minor
This commit is contained in:
parent
e9d0065876
commit
6018de870d
@ -275,13 +275,15 @@ class Misc(commands.Cog):
|
|||||||
|
|
||||||
@bridge.bridge_command()
|
@bridge.bridge_command()
|
||||||
async def compliment(self, ctx, *,
|
async def compliment(self, ctx, *,
|
||||||
recipient: Optional[str] = None) -> None:
|
recipient: Optional[str] = None,
|
||||||
|
language: Optional[str] = 'en') -> None:
|
||||||
"""
|
"""
|
||||||
Compliment someone (or yourself)
|
Compliment someone (or yourself)
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
ctx (Any)
|
ctx (Any)
|
||||||
recipient (Optional[str])
|
recipient (Optional[str])
|
||||||
|
language (Optional[str]) (default: 'en')
|
||||||
Returns:
|
Returns:
|
||||||
None
|
None
|
||||||
"""
|
"""
|
||||||
@ -305,7 +307,7 @@ class Misc(commands.Cog):
|
|||||||
else:
|
else:
|
||||||
recipient = discord.utils.escape_mentions(recipient.strip())
|
recipient = discord.utils.escape_mentions(recipient.strip())
|
||||||
with ctx.channel.typing():
|
with ctx.channel.typing():
|
||||||
compliment: str = await self.util.get_compliment(recipient)
|
compliment: str = await self.util.get_compliment(recipient, language)
|
||||||
if compliment:
|
if compliment:
|
||||||
return await ctx.respond(compliment)
|
return await ctx.respond(compliment)
|
||||||
return await ctx.respond("Compliment failed :(")
|
return await ctx.respond("Compliment failed :(")
|
||||||
|
@ -207,19 +207,17 @@ class Util:
|
|||||||
|
|
||||||
|
|
||||||
async def get_compliment(self, subject: str,
|
async def get_compliment(self, subject: str,
|
||||||
language: Optional[str] = None) -> str:
|
language: Optional[str] = 'en') -> str:
|
||||||
"""
|
"""
|
||||||
Get Compliment
|
Get Compliment
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
subject (str)
|
subject (str)
|
||||||
language (Optional[str])
|
language (Optional[str]) (default: 'en')
|
||||||
Returns:
|
Returns:
|
||||||
str
|
str
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not language:
|
|
||||||
return self.COMPLIMENT_GENERATOR.compliment(subject)
|
|
||||||
return self.COMPLIMENT_GENERATOR.compliment_in_language(subject, language)
|
return self.COMPLIMENT_GENERATOR.compliment_in_language(subject, language)
|
||||||
|
|
||||||
async def get_whisky(self) -> Optional[tuple]:
|
async def get_whisky(self) -> Optional[tuple]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user