Change typing

This commit is contained in:
bobloy 2021-01-14 11:32:51 -05:00
parent 9bdaf73944
commit 6c669dd170

View File

@ -1,11 +1,10 @@
import logging import logging
from typing import List, Union from typing import Optional
import discord import discord
from redbot.core import Config, checks, commands from redbot.core import Config, checks, commands
from redbot.core.bot import Red from redbot.core.bot import Red
from redbot.core.commands import Cog from redbot.core.commands import Cog
from redbot.core.utils import AsyncIter
from redbot.core.utils.menus import DEFAULT_CONTROLS, menu from redbot.core.utils.menus import DEFAULT_CONTROLS, menu
from werewolf.builder import ( from werewolf.builder import (
@ -392,7 +391,7 @@ class Werewolf(Cog):
else: else:
await ctx.maybe_send_embed("Role ID not found") await ctx.maybe_send_embed("Role ID not found")
async def _get_game(self, ctx: commands.Context, game_code=None) -> Union[Game, None]: async def _get_game(self, ctx: commands.Context, game_code=None) -> Optional[Game]:
guild: discord.Guild = getattr(ctx, "guild", None) guild: discord.Guild = getattr(ctx, "guild", None)
if guild is None: if guild is None:
@ -419,7 +418,7 @@ class Werewolf(Cog):
return self.games[guild.id] return self.games[guild.id]
async def _game_start(self, game): async def _game_start(self, game: Game):
await game.start() await game.start()
async def _get_settings(self, ctx): async def _get_settings(self, ctx):