[commands] Raise appropriate exception for no guild found

This commit is contained in:
Rapptz
2022-04-04 21:49:11 -04:00
parent 8b50ac8a31
commit dbcdf69eb1
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ from typing import TYPE_CHECKING, Any, Literal, Optional, OrderedDict, Union
from discord.utils import MISSING, maybe_coroutine
from .errors import MissingRequiredArgument
from .errors import NoPrivateMessage
if TYPE_CHECKING:
from typing_extensions import Self
@ -229,7 +229,7 @@ CurrentChannel = parameter(
def default_guild(ctx: Context) -> Guild:
if ctx.guild is not None:
return ctx.guild
raise MissingRequiredArgument(ctx.current_parameter) # type: ignore # this is never going to be None
raise NoPrivateMessage()
CurrentGuild = parameter(