Skip to content

Commit

Permalink
Re-export events and models in public namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Aug 23, 2021
1 parent b1db78f commit 364ea04
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mutiny/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

__version__ = "0.2.0a0"

from . import events
from . import events, models
from ._internal.client import Client

__all__ = (
"events",
"models",
"Client",
)
69 changes: 69 additions & 0 deletions src/mutiny/events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 2021 Jakub Kuczys (https://github.com/jack1142)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ._internal.events import (
AuthenticatedEvent,
ChannelAckEvent,
ChannelCreateEvent,
ChannelDeleteEvent,
ChannelGroupJoinEvent,
ChannelGroupLeaveEvent,
ChannelStartTypingEvent,
ChannelStopTypingEvent,
ChannelUpdateEvent,
ErrorEvent,
Event,
MessageDeleteEvent,
MessageEvent,
MessageUpdateEvent,
PongEvent,
ReadyEvent,
ServerDeleteEvent,
ServerMemberJoinEvent,
ServerMemberLeaveEvent,
ServerMemberUpdateEvent,
ServerRoleDeleteEvent,
ServerRoleUpdateEvent,
ServerUpdateEvent,
UserRelationshipEvent,
UserUpdateEvent,
)

__all__ = (
"AuthenticatedEvent",
"ChannelAckEvent",
"ChannelCreateEvent",
"ChannelDeleteEvent",
"ChannelGroupJoinEvent",
"ChannelGroupLeaveEvent",
"ChannelStartTypingEvent",
"ChannelStopTypingEvent",
"ChannelUpdateEvent",
"ErrorEvent",
"Event",
"MessageDeleteEvent",
"MessageEvent",
"MessageUpdateEvent",
"PongEvent",
"ReadyEvent",
"ServerDeleteEvent",
"ServerMemberJoinEvent",
"ServerMemberLeaveEvent",
"ServerMemberUpdateEvent",
"ServerRoleDeleteEvent",
"ServerRoleUpdateEvent",
"ServerUpdateEvent",
"UserRelationshipEvent",
"UserUpdateEvent",
)
164 changes: 164 additions & 0 deletions src/mutiny/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Copyright 2021 Jakub Kuczys (https://github.com/jack1142)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ._internal.models.attachment import (
Attachment,
AttachmentMetadata,
AttachmentTag,
AudioMetadata,
FileMetadata,
ImageMetadata,
TextMetadata,
UnknownMetadata,
VideoMetadata,
)
from ._internal.models.channel import (
Channel,
DirectMessage,
Group,
SavedMessages,
TextChannel,
UnknownChannel,
VoiceChannel,
)
from ._internal.models.embed import (
BandcampType,
Embed,
EmbeddedBandcamp,
EmbeddedImage,
EmbeddedNone,
EmbeddedSpecial,
EmbeddedSpotify,
EmbeddedTwitch,
EmbeddedUnknown,
EmbeddedVideo,
EmbeddedYouTube,
ImageEmbed,
ImageSize,
NoneEmbed,
TwitchType,
UnknownEmbed,
WebsiteEmbed,
)
from ._internal.models.message import (
ChannelDescriptionChangedSystemMessage,
ChannelIconChangedSystemMessage,
ChannelRenamedSystemMessage,
Message,
SystemMessage,
TextSystemMessage,
UnknownSystemMessage,
UserAddedSystemMessage,
UserBannedSystemMessage,
UserJoinedSystemMessage,
UserKickedSystemMessage,
UserLeftSystemMessage,
UserRemovedSystemMessage,
)
from ._internal.models.permissions import (
ChannelPermissions,
ServerPermissions,
UserPermissions,
)
from ._internal.models.server import (
Category,
Member,
Role,
Server,
SystemMessageChannels,
)
from ._internal.models.user import (
Badges,
BotInfo,
Presence,
Relationship,
RelationshipStatus,
Status,
User,
UserFlags,
UserProfile,
)

__all__ = (
# .attachment
"Attachment",
"AttachmentMetadata",
"AttachmentTag",
"AudioMetadata",
"FileMetadata",
"ImageMetadata",
"TextMetadata",
"UnknownMetadata",
"VideoMetadata",
# .channel
"Channel",
"DirectMessage",
"Group",
"SavedMessages",
"TextChannel",
"UnknownChannel",
"VoiceChannel",
# .embed
"BandcampType",
"Embed",
"EmbeddedBandcamp",
"EmbeddedImage",
"EmbeddedNone",
"EmbeddedSpecial",
"EmbeddedSpotify",
"EmbeddedTwitch",
"EmbeddedUnknown",
"EmbeddedVideo",
"EmbeddedYouTube",
"ImageEmbed",
"ImageSize",
"NoneEmbed",
"TwitchType",
"UnknownEmbed",
"WebsiteEmbed",
# .message
"ChannelDescriptionChangedSystemMessage",
"ChannelIconChangedSystemMessage",
"ChannelRenamedSystemMessage",
"Message",
"SystemMessage",
"TextSystemMessage",
"UnknownSystemMessage",
"UserAddedSystemMessage",
"UserBannedSystemMessage",
"UserJoinedSystemMessage",
"UserKickedSystemMessage",
"UserLeftSystemMessage",
"UserRemovedSystemMessage",
# .permissions
"ChannelPermissions",
"ServerPermissions",
"UserPermissions",
# .server
"Category",
"Member",
"Role",
"Server",
"SystemMessageChannels",
# .user
"Badges",
"BotInfo",
"Presence",
"Relationship",
"RelationshipStatus",
"Status",
"User",
"UserFlags",
"UserProfile",
)

0 comments on commit 364ea04

Please sign in to comment.