diff options
| author | 2019-09-19 06:12:11 -0700 | |
|---|---|---|
| committer | 2019-09-19 06:12:11 -0700 | |
| commit | ad65e0d36ce24444795fd80202f4b76d7e6946f5 (patch) | |
| tree | 374a8a3c505f2dd0e54b466099e4dada916836a0 /bot/cogs/reminders.py | |
| parent | Use Optional typing shorthand rather than Union w/None (diff) | |
Replace incorrect None returns with Optional in certain commands
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/reminders.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/cogs/reminders.py b/bot/cogs/reminders.py index ff0a6eb1a..a96684db3 100644 --- a/bot/cogs/reminders.py +++ b/bot/cogs/reminders.py @@ -4,9 +4,10 @@ import random import textwrap from datetime import datetime from operator import itemgetter +from typing import Optional from dateutil.relativedelta import relativedelta -from discord import Colour, Embed +from discord import Colour, Embed, Message from discord.ext.commands import Bot, Cog, Context, group from bot.constants import Channels, Icons, NEGATIVE_REPLIES, POSITIVE_REPLIES, STAFF_ROLES @@ -122,7 +123,7 @@ class Reminders(Scheduler, Cog): await ctx.invoke(self.new_reminder, expiration=expiration, content=content) @remind_group.command(name="new", aliases=("add", "create")) - async def new_reminder(self, ctx: Context, expiration: ExpirationDate, *, content: str) -> None: + async def new_reminder(self, ctx: Context, expiration: ExpirationDate, *, content: str) -> Optional[Message]: """ Set yourself a simple reminder. @@ -178,7 +179,7 @@ class Reminders(Scheduler, Cog): self.schedule_task(loop, reminder["id"], reminder) @remind_group.command(name="list") - async def list_reminders(self, ctx: Context) -> None: + async def list_reminders(self, ctx: Context) -> Optional[Message]: """View a paginated embed of all reminders for your user.""" # Get all the user's reminders from the database. data = await self.bot.api_client.get( |