@@ -20,12 +20,12 @@ async def an_event_handler(event: ChannelCreate):
20
20
21
21
"""
22
22
23
- from typing import TYPE_CHECKING , List , Sequence , Union , Optional
23
+ from typing import TYPE_CHECKING , List , Optional , Sequence , Union
24
24
25
25
import attrs
26
26
27
27
import interactions .models
28
- from interactions .api .events .base import GuildEvent , BaseEvent
28
+ from interactions .api .events .base import BaseEvent , GuildEvent
29
29
from interactions .client .const import Absent
30
30
from interactions .client .utils .attr_utils import docs
31
31
from interactions .models .discord .snowflake import to_snowflake
@@ -99,30 +99,34 @@ async def an_event_handler(event: ChannelCreate):
99
99
100
100
101
101
if TYPE_CHECKING :
102
- from interactions .models .discord .guild import Guild , GuildIntegration
103
- from interactions .models .discord .channel import BaseChannel , TYPE_THREAD_CHANNEL , VoiceChannel
104
- from interactions .models .discord .message import Message
105
- from interactions .models .discord .timestamp import Timestamp
106
- from interactions .models .discord .user import Member , User , BaseUser
107
- from interactions .models .discord .snowflake import Snowflake_Type
108
102
from interactions .models .discord .activity import Activity
103
+ from interactions .models .discord .app_perms import ApplicationCommandPermission
104
+ from interactions .models .discord .auto_mod import AutoModerationAction , AutoModRule
105
+ from interactions .models .discord .channel import (
106
+ TYPE_ALL_CHANNEL ,
107
+ TYPE_THREAD_CHANNEL ,
108
+ VoiceChannel ,
109
+ )
109
110
from interactions .models .discord .emoji import CustomEmoji , PartialEmoji
111
+ from interactions .models .discord .guild import Guild , GuildIntegration
112
+ from interactions .models .discord .message import Message
113
+ from interactions .models .discord .reaction import Reaction
110
114
from interactions .models .discord .role import Role
115
+ from interactions .models .discord .scheduled_event import ScheduledEvent
116
+ from interactions .models .discord .snowflake import Snowflake_Type
117
+ from interactions .models .discord .stage_instance import StageInstance
111
118
from interactions .models .discord .sticker import Sticker
119
+ from interactions .models .discord .timestamp import Timestamp
120
+ from interactions .models .discord .user import BaseUser , Member , User
112
121
from interactions .models .discord .voice_state import VoiceState
113
- from interactions .models .discord .stage_instance import StageInstance
114
- from interactions .models .discord .auto_mod import AutoModerationAction , AutoModRule
115
- from interactions .models .discord .reaction import Reaction
116
- from interactions .models .discord .app_perms import ApplicationCommandPermission
117
- from interactions .models .discord .scheduled_event import ScheduledEvent
118
122
119
123
120
124
@attrs .define (eq = False , order = False , hash = False , kw_only = False )
121
125
class AutoModExec (BaseEvent ):
122
126
"""Dispatched when an auto modation action is executed"""
123
127
124
128
execution : "AutoModerationAction" = attrs .field (repr = False , metadata = docs ("The executed auto mod action" ))
125
- channel : "BaseChannel " = attrs .field (repr = False , metadata = docs ("The channel the action was executed in" ))
129
+ channel : "TYPE_ALL_CHANNEL " = attrs .field (repr = False , metadata = docs ("The channel the action was executed in" ))
126
130
guild : "Guild" = attrs .field (repr = False , metadata = docs ("The guild the action was executed in" ))
127
131
128
132
@@ -164,18 +168,18 @@ class ApplicationCommandPermissionsUpdate(BaseEvent):
164
168
class ChannelCreate (BaseEvent ):
165
169
"""Dispatched when a channel is created."""
166
170
167
- channel : "BaseChannel " = attrs .field (repr = False , metadata = docs ("The channel this event is dispatched from" ))
171
+ channel : "TYPE_ALL_CHANNEL " = attrs .field (repr = False , metadata = docs ("The channel this event is dispatched from" ))
168
172
169
173
170
174
@attrs .define (eq = False , order = False , hash = False , kw_only = False )
171
175
class ChannelUpdate (BaseEvent ):
172
176
"""Dispatched when a channel is updated."""
173
177
174
- before : "BaseChannel " = attrs .field (
178
+ before : "TYPE_ALL_CHANNEL " = attrs .field (
175
179
repr = False ,
176
180
)
177
181
"""Channel before this event. MISSING if it was not cached before"""
178
- after : "BaseChannel " = attrs .field (
182
+ after : "TYPE_ALL_CHANNEL " = attrs .field (
179
183
repr = False ,
180
184
)
181
185
"""Channel after this event"""
@@ -226,7 +230,7 @@ class ThreadListSync(BaseEvent):
226
230
repr = False ,
227
231
)
228
232
"""The parent channel ids whose threads are being synced. If omitted, then threads were synced for the entire guild. This array may contain channel_ids that have no active threads as well, so you know to clear that data."""
229
- threads : List ["BaseChannel " ] = attrs .field (
233
+ threads : List ["TYPE_ALL_CHANNEL " ] = attrs .field (
230
234
repr = False ,
231
235
)
232
236
"""all active threads in the given channels that the current user can access"""
@@ -618,7 +622,7 @@ class TypingStart(BaseEvent):
618
622
repr = False ,
619
623
)
620
624
"""The user who started typing"""
621
- channel : "BaseChannel " = attrs .field (
625
+ channel : "TYPE_ALL_CHANNEL " = attrs .field (
622
626
repr = False ,
623
627
)
624
628
"""The channel typing is in"""
0 commit comments