Browse Source

Remove redundant imports and variables

pull/7796/head
Kellen 3 years ago
committed by GitHub
parent
commit
4fd2d5fdfd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      discord/ext/commands/converter.py
  2. 6
      discord/http.py
  3. 2
      discord/interactions.py
  4. 3
      discord/member.py
  5. 3
      discord/message.py
  6. 1
      discord/shard.py
  7. 1
      discord/types/guild.py

2
discord/ext/commands/converter.py

@ -461,8 +461,6 @@ class GuildChannelConverter(IDConverter[discord.abc.GuildChannel]):
@staticmethod @staticmethod
def _resolve_thread(ctx: Context[BotT], argument: str, attribute: str, type: Type[TT]) -> TT: def _resolve_thread(ctx: Context[BotT], argument: str, attribute: str, type: Type[TT]) -> TT:
bot = ctx.bot
match = IDConverter._get_id_match(argument) or re.match(r'<#([0-9]{15,20})>$', argument) match = IDConverter._get_id_match(argument) or re.match(r'<#([0-9]{15,20})>$', argument)
result = None result = None
guild = ctx.guild guild = ctx.guild

6
discord/http.py

@ -66,10 +66,7 @@ if TYPE_CHECKING:
from .embeds import Embed from .embeds import Embed
from .message import Attachment from .message import Attachment
from .flags import MessageFlags from .flags import MessageFlags
from .enums import ( from .enums import AuditLogAction
AuditLogAction,
InteractionResponseType,
)
from .types import ( from .types import (
appinfo, appinfo,
@ -86,7 +83,6 @@ if TYPE_CHECKING:
role, role,
user, user,
webhook, webhook,
channel,
widget, widget,
threads, threads,
scheduled_event, scheduled_event,

2
discord/interactions.py

@ -69,7 +69,7 @@ if TYPE_CHECKING:
from .ui.view import View from .ui.view import View
from .app_commands.models import Choice, ChoiceT from .app_commands.models import Choice, ChoiceT
from .ui.modal import Modal from .ui.modal import Modal
from .channel import VoiceChannel, StageChannel, TextChannel, CategoryChannel, PartialMessageable from .channel import VoiceChannel, StageChannel, TextChannel, CategoryChannel
from .threads import Thread from .threads import Thread
from .app_commands.commands import Command, ContextMenu from .app_commands.commands import Command, ContextMenu

3
discord/member.py

@ -28,7 +28,7 @@ import datetime
import inspect import inspect
import itertools import itertools
from operator import attrgetter from operator import attrgetter
from typing import Any, Callable, Collection, Coroutine, Dict, List, Literal, Optional, TYPE_CHECKING, Tuple, Union, Type from typing import Any, Callable, Collection, Coroutine, Dict, List, Optional, TYPE_CHECKING, Tuple, Union, Type
import discord.abc import discord.abc
@ -51,7 +51,6 @@ __all__ = (
if TYPE_CHECKING: if TYPE_CHECKING:
from typing_extensions import Self from typing_extensions import Self
from .asset import Asset
from .channel import DMChannel, VoiceChannel, StageChannel from .channel import DMChannel, VoiceChannel, StageChannel
from .flags import PublicUserFlags from .flags import PublicUserFlags
from .guild import Guild from .guild import Guild

3
discord/message.py

@ -40,7 +40,6 @@ from typing import (
Callable, Callable,
Tuple, Tuple,
ClassVar, ClassVar,
Optional,
Type, Type,
overload, overload,
) )
@ -85,7 +84,7 @@ if TYPE_CHECKING:
from .types.embed import Embed as EmbedPayload from .types.embed import Embed as EmbedPayload
from .types.gateway import MessageReactionRemoveEvent, MessageUpdateEvent from .types.gateway import MessageReactionRemoveEvent, MessageUpdateEvent
from .abc import Snowflake from .abc import Snowflake
from .abc import GuildChannel, PartialMessageableChannel, MessageableChannel from .abc import GuildChannel, MessageableChannel
from .components import Component from .components import Component
from .state import ConnectionState from .state import ConnectionState
from .channel import TextChannel from .channel import TextChannel

1
discord/shard.py

@ -48,7 +48,6 @@ from typing import TYPE_CHECKING, Any, Callable, Tuple, Type, Optional, List, Di
if TYPE_CHECKING: if TYPE_CHECKING:
from .gateway import DiscordWebSocket from .gateway import DiscordWebSocket
from .activity import BaseActivity from .activity import BaseActivity
from .enums import Status
__all__ = ( __all__ = (
'AutoShardedClient', 'AutoShardedClient',

1
discord/types/guild.py

@ -35,7 +35,6 @@ from .role import Role
from .member import Member from .member import Member
from .emoji import Emoji from .emoji import Emoji
from .user import User from .user import User
from .sticker import GuildSticker
from .threads import Thread from .threads import Thread

Loading…
Cancel
Save