Changelog¶
This document displays the differences between each release of curious.
0.7.8 (Released 2018-05-23)¶
- Fix
HTTPClient.leave_guild().- Fix a crash on
MEMBER_UPDATEpackets.- Make mentions in DMs return correctly (and also, not crash).
- Fix new
VoiceStateobjects not having a client object.- Add the ability to move members into a different voice channel.
- Add
zlib-streamas the compression method for the gateway.
0.7.7 (Released 2018-04-04)¶
- Fix trying to convert a default.
- Add a
typing.Unionconverter.
0.7.6 (Released 2018-04-03)¶
0.7.5 (Released 2018-04-01)¶
- Don’t crash when trying to fill in guild fields without a cached guild.
0.7.4 (Released 2018-03-27)¶
- Fix for negative ratelimit sleep times.
- Don’t crash when copying a nickname incorrectly.
0.7.3 (Released 2018-03-27)¶
- Don’t immediately disconnect on boot.
0.7.2 (Released 2018-03-27)¶
- Changed
Nicknameto be a proper object, and not a string wrapper.- Fix
Member.roles._sorted_rolesto sort in reverse order.- Attempt at adding better reconnect logic.
0.7.1 (Released 2018-03-12)¶
- Fixed
Channel.permissions()(thanks PyCharm)
0.7.0 (Released 2018-03-11)¶
Add get-by-name to
GuildChannelWrapper, andGuildRoleWrapper.Add
Invite.features.Add
GameTypefor game types.Make
Invite.invitera property that returns aMemberif one can be found.Remove
Client.boot_shard()amongst others, and createClient.handle_shard()to do all gateway-related handling functions.Add
Channel.overwritesfor a key-value mapping of overwrites.Add
Nickname, and makeMember.nicknamean instance ofNickname.Rename
MEMBER_events toGUILD_MEMBER_events.Add
_MemberRoleContainer, and makeMember.rolesan instance of this.Add
Message.emojis.Add
ChannelMessagesWrapper, and move everything to point to it.Rewrite the gateway code significantly.
- Use Lomond in a thread instead of our own wrapper.
- Make opening a gateway a context manager.
- Use proper dataclasses for state.
Add
AvatarUrl.Add
GuildBan, and makeGuild.get_bans()return a list of those.Move
Guild._splash_hashandGuild._icon_hashto public attributes.Add a
permissions.pyifile for static introspection of the permissions class.Add a
GuildBanContainer.Enable
triosupport.Add
autoplugin()which automatically assigns commands inside a plugin.Add
Plugin.spawn()for easy background task spawning.Add
Channel.childrento get the children of a channel.Deprivatize
State.find_message().Lookup messages in the cache to avoid a roundtrip when doing
ChannelMessagesWrapper.get().
0.6.0 (Released 2017-11-05)¶
Bring voice code inline with the standard of the rest of the code.
- Change the voice gateway to use an async thread, rather than a regular thread.
- Document and make public
VoiceClient.get_packet_header(),VoiceClient.get_voice_packet()andVoiceClient.get_ip_discovery_packet().Only sleep on shard creation until the last shard.
Move
Channel.is_private()toChannel.private().Move
IDObject.timestamp()toIDObject.snowflake_timestamp().Make some things use ID references rather than object references, and deprivatize the ID attributes on these objects.
Add support for channel categories in the API and the gateway.
Reorganize commands code significantly:
- Move all of the commands code out of
Client.- Add new
CommandsManager.- Overhaul
Contextto do more, such as the actual processing.- Remove
Commandin favour of annotated functions.Reorganize events code significantly:
- Move all the events code out of
Client.- Add new
EventManager.- Add event hooks, which are called with every event the bot receives.
- Overhaul
EventManager.wait_for()so that it usescurio.Promiserather than terrible events.- Change temporary listeners to raising ListenerExit instead of returning a truthy/falsey value.
Reboot shards properly when they disconnect, using a while True loop inside the TaskGroup.
Add
State.guilds_ordered.Add a 5 second timeout to each request made.
Add
Message.get_invites()andMessage.invitesto get invites that are inside a message object.Retry on h11 errors.
Use
asyncwebsocketsinstead ofcuiows.
ReactionPaginatorcan now have an optional title that is added as the content for the message sent.
0.5.1 (Released 2017-08-19)¶
- Switch to the
asksHTTP library over the bundled HTTP library.- Add
MessageType.- Add
ChannelType.CATEGORY.- Separate out HTTP URLs into a
Endpointsclass.- Properly wait on shards in the start handler.
0.5.0 (Released 2017-07-31)¶
Warning
This is the last version of curious that supports Python 3.5.
Add gateway event dispatching.
Add
HTTPClient.get_vanity_url()andHTTPClient.edit_vanity_url().Add
Guild.get_vanity_invite()andGuild.set_vanity_invite().
Guild.get_invites()will now return the vanity invite, if applicable.Rearrange guild objects somewhat:
- Turn
Guild.channelsinto aGuildChannelWrapper.- Turn
Guild.rolesinto aGuildRoleWrapper.- Move
Guild.create_channel()toGuildChannelWrapper.create().- Move
Guild.edit_channel()toChannel.edit().- Move
Guild.delete_channel()toChannel.delete().- Move
Guild.create_role()toGuildRoleWrapper.create().- Move
Guild.edit_role()toRole.edit().- Move
Guild.delete_role()toRole.delete().Add a
message_mentionedevent.
Guild.largenow obeys a customlarge_threshold.Add counts to
guild_chunkandguild_syncevents.Fix editing profile via
User.edit().Add
HTTPClient.get_user_applications()andHTTPClient.get_application().Don’t include
@everyonewhen calculating role colours.
0.4.0 (Released 2017-04-27)¶
VoiceStatenow uses a property reference to the User object.Add
BotUser.authorized_appswhich returns an async iterator that can be used to get the authorized apps for this bot.Add
BotUser.get_recent_mentions()andGuild.get_recent_mentions()to allow easy iteration of recent mentions.Change statuses to new
Presence, which are stored on Member and RelationshipUser instances.
Guild._largeis now set by GUILD_SYNC handling for userbots.Optimize
State.make_message()slightly, by checking the cache before editing it.
_prepare_request()automatically stringifies all items in the query string before sending it.Add search support:
HTTPClient.search_channel()andHTTPClient.search_guild()are the raw HTTP methods for searching.SearchQuery,SearchResultsandMessageGroupare the high level wrappers for searching.Add
AsyncIteratorWrapper.next()andAsyncIteratorWrapper.all().Change
Guildobjects on dataclasses to mostly look up via property or weak reference rather than having a strong reference.Change commands:
- A callable that takes
(bot, message)and returns (a) prefix(es) to match can now be provided forcommand_prefix.- Functions are unwrapped for the .factory attr if possible.
Add the ability to listen to multiple events with one function.
Add
MFALevel,VerificationLevel,NotificationLevel,ContentFilterLevel, and update the relevant attributes onGuild.Add HTTP downloading methods to
Client.Add
Channel.nsfw.
0.3.0 (Released 2017-03-10)¶
Client.start()will now automatically reboot shards that return.Add
HTTPClient.get_authorized_apps()to get the authorized apps for this account.Add
HTTPClient.revoke_authorized_app()to revoke an application’s authorization.Add
BotUser.get_authorized_apps()as the high-level equivalent.Add
Message.channel_idandMessage.author_idto access the raw IDs from Discord, even if the message author or channel is not cached.Unprivatize
State.find_channel()and addClient.find_channel()to use this method.Unprivatize
State.is_ready().Change sharding slightly:
Client.boot_shard()will boot one shard and add its gateway to the internal list. This will allow finer control over shard booting.Client.start()will now useboot_shardto load a shard, so overriding it in a subclass can customize shard creation.The client will now wait for the gateway to be ready before firing any events.
Add
BotTypeto more finely control how bots are defined.Add
Client.events_handledandGateway._dispatches_handledto show how many events have been handled during the lifetime of the bot.Add
GuildStorewhich tracks the order of guilds for user bots, and can be used to return the guilds in that order.Change
Channelfor group DMs slightly:
- New attributes have been added:
Channel.owner,Channel.owner_id,Channel._icon_hash,Channel.icon_url.Channel._recipientshas been added to replacerecipientsas the backing store, and is now a dict.- Correspondingly,
Channel.recipientsis a mapping proxy forChannel._recipients, and can be used to access the recipients of the channel.Add
HTTPClient.update_user_settings()to update the settings of a user.Add
UserSettingsto represent the settings of a user.Add event handler for
USER_SETTINGS_UPDATE.
0.2.1 (Released 2017-02-23)¶
- Sync/chunk guilds when a
GUILD_CREATEis received during the main bot lifecycle.- Decache users automatically when a
GUILD_DELETEis received.- Fix the default role not being accounted for in permissions.
- Fix
GUILD_ROLE_DELETEhandling.- Fix async threads hanging the bot on shutdown.
- Add the ability to set
afkin a presence change, to allow self-bots to not eat notifications.- Userbots will now ask for member chunks and then sync guilds once all chunks are received.
- Make
Guild.largea property rather than an attribute. Discord doesn’t always send this properly, so fallback tomember_count >= 250.
0.2.0 (Released 2017-02-20)¶
Add user account logging in support.
Add
_friendsand_blockedtoStateto represent the friends and blocked users a client has.Add
friendsandblockedproperties toBotUserwhich can be used to access the State’s attributes.Add a new type called
RelationshipUserwhich represents either a friend or a blocked user.Rearrange channel and guild handling in
READYparsing.Fix
authorinside private DMs being wrong sometimes.Allow group DMs to work properly.
User cache has been redesigned:
State.make_user()now takes auser_klassparam which allows customization of the user class created when caching a user.Users are now updated in
PRESENCE_UPDATErather thanGUILD_MEMBER_UPDATE.
GUILD_SYNCis now supported for user bots.Creating
HTTPClientwithbot=Falsewill send a user authorization header rather than a bot authorization header.Add
HTTPClient.get_user_profile()to get a user’s profile.Add
HTTPClient.get_app_info()to get the application information for a specific app. This method will attempt to download the bot information alongside the app - failing this, it will only request the basic app info scope.Remove
HTTPClient.get_application_info(); callget_app_infowithNoneto get the current app’s info.Add
HTTPClient.authorize_bot()to authorize a bot into a guild.Move
AppInfointo its own module.Make
AppInfomore useful than just the current application’s info.Add
botattribute toAppInfowhich returns the bot user associated with this app.Add
AppInfo.add_to_guild()which authorizes a bot into a guild. Only user accounts can call this.Add
Client.get_application()to get anAppInfoobject referring to an application.Add
HTTPClient.send_friend_request(),HTTPClient.remove_relationship(),HTTPClient.block_user()for editing relationships with users.Add
User.send_friend_request(),User.block(),RelationshipUser.remove_friend()andRelationshipUser.unblock()to manage relationships between users.
BotUsercannot send friend requests to itself or block itself.Add
User.get_profile()to get a user’s profile.
Embed.set_image()now validates that the link is a HTTP[S] link.
0.1.4¶
- Add
Widgetfor support of widgets.- Add widget support inside the HTTPClient.
- Fix events inside plugins.
- Add new error code mapping to
HTTPException. This provides clearer display as to what went wrong when performing a HTTP method.