diff options
| author | 2021-02-05 06:54:02 +0530 | |
|---|---|---|
| committer | 2021-02-05 06:54:02 +0530 | |
| commit | d9a40f8591de1537b38d261e77b42ddc8cbc5688 (patch) | |
| tree | f86bb07f613c2210a51371ce78123f2d269df736 | |
| parent | Remove code that requires intents.member set True (diff) | |
If whom is None, take the user as whom
| -rw-r--r-- | bot/exts/valentines/lovecalculator.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/exts/valentines/lovecalculator.py b/bot/exts/valentines/lovecalculator.py index 5cc08fed..966acc82 100644 --- a/bot/exts/valentines/lovecalculator.py +++ b/bot/exts/valentines/lovecalculator.py @@ -4,7 +4,7 @@ import json import logging import random from pathlib import Path -from typing import Union +from typing import Coroutine, Union import discord from discord import Member @@ -26,7 +26,7 @@ class LoveCalculator(Cog): @commands.command(aliases=('love_calculator', 'love_calc')) @commands.cooldown(rate=1, per=5, type=commands.BucketType.user) - async def love(self, ctx: commands.Context, who: Union[Member, str], whom: Union[Member, str]) -> None: + async def love(self, ctx: commands.Context, who: Union[Member, str], whom: Union[Member, str] = None) -> None: """ Tells you how much the two love each other. @@ -45,7 +45,10 @@ class LoveCalculator(Cog): If you want to use multiple words for one argument, you must include quotes. .love "Zes Vappa" "morning coffee" """ - def normalize(arg: Union[Member, str]) -> str: + if whom is None: + whom = ctx.author + + def normalize(arg: Union[Member, str]) -> Coroutine: if isinstance(arg, Member): # If we are given a member, return name#discrim without any extra changes arg = str(arg) |