Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nonebot.adapters.discord 应在 try 块内导入 #171

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions nonebot_plugin_saa/adapters/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
from nonebot.adapters import Event
from nonebot.drivers import Request
from nonebot.adapters import Bot as BaseBot
from nonebot.adapters.discord.api.model import (
File,
Embed,
MessageFlag,
AllowedMention,
AttachmentSend,
DirectComponent,
)

from ..auto_select_bot import register_list_targets
from ..types import Text, Image, Reply, Mention, MentionAll
Expand All @@ -38,12 +30,22 @@
with suppress(ImportError):
from nonebot.adapters.discord import Bot as BotDiscord
from nonebot.adapters.discord.message import Message, MessageSegment
from nonebot.adapters.discord.api.model import Snowflake, MessageGet, SnowflakeType
from nonebot.adapters.discord.event import (
MessageEvent,
MessageCreateEvent,
ChannelPinsUpdateEvent,
)
from nonebot.adapters.discord.api.model import (
File,
Embed,
Snowflake,
MessageGet,
MessageFlag,
SnowflakeType,
AllowedMention,
AttachmentSend,
DirectComponent,
)

adapter = SupportedAdapters.discord
register_discord = partial(register_ms_adapter, adapter)
Expand Down
Loading