# SOME DESCRIPTIVE TITLE. # Copyright (C) 2015-2017, Rapptz # This file is distributed under the same license as the discord.py package. # FIRST AUTHOR , 2018. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: discord.py 1.0.0a\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-07-31 14:21-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.5.3\n" #: ../../migrating.rst:6 msgid "Migrating to v1.0" msgstr "" #: ../../migrating.rst:8 msgid "" "v1.0 is one of the biggest breaking changes in the library due to a " "complete redesign." msgstr "" #: ../../migrating.rst:11 msgid "" "The amount of changes are so massive and long that for all intents and " "purposes, it is a completely new library." msgstr "" #: ../../migrating.rst:14 msgid "" "Part of the redesign involves making things more easy to use and natural." " Things are done on the :ref:`models ` instead of " "requiring a :class:`Client` instance to do any work." msgstr "" #: ../../migrating.rst:18 msgid "Python Version Change" msgstr "" #: ../../migrating.rst:20 msgid "" "In order to make development easier and also to allow for our " "dependencies to upgrade to allow usage of 3.7 or higher, the library had " "to remove support for Python versions lower than 3.5.3, which essentially" " means that **support for Python 3.4 is dropped**." msgstr "" #: ../../migrating.rst:25 msgid "Major Model Changes" msgstr "" #: ../../migrating.rst:27 msgid "Below are major model changes that have happened in v1.0" msgstr "" #: ../../migrating.rst:30 msgid "Snowflakes are int" msgstr "" #: ../../migrating.rst:32 msgid "" "Before v1.0, all snowflakes (the ``id`` attribute) were strings. This has" " been changed to :class:`int`." msgstr "" #: ../../migrating.rst:34 ../../migrating.rst:252 msgid "Quick example: ::" msgstr "" #: ../../migrating.rst:46 msgid "" "This change allows for fewer errors when using the Copy ID feature in the" " official client since you no longer have to wrap it in quotes and allows" " for optimisation opportunities by allowing ETF to be used instead of " "JSON internally." msgstr "" #: ../../migrating.rst:50 msgid "Server is now Guild" msgstr "" #: ../../migrating.rst:52 msgid "" "The official API documentation calls the \"Server\" concept a \"Guild\" " "instead. In order to be more consistent with the API documentation when " "necessary, the model has been renamed to :class:`Guild` and all instances" " referring to it has been changed as well." msgstr "" #: ../../migrating.rst:56 msgid "A list of changes is as follows:" msgstr "" #: ../../migrating.rst:59 ../../migrating.rst:95 ../../migrating.rst:852 msgid "Before" msgstr "" #: ../../migrating.rst:59 ../../migrating.rst:95 ../../migrating.rst:852 msgid "After" msgstr "" #: ../../migrating.rst:61 msgid "``Message.server``" msgstr "" #: ../../migrating.rst:61 msgid ":attr:`Message.guild`" msgstr "" #: ../../migrating.rst:63 msgid "``Channel.server``" msgstr "" #: ../../migrating.rst:63 msgid ":attr:`.GuildChannel.guild`" msgstr "" #: ../../migrating.rst:65 msgid "``Client.servers``" msgstr "" #: ../../migrating.rst:65 ../../migrating.rst:231 msgid ":attr:`Client.guilds`" msgstr "" #: ../../migrating.rst:67 msgid "``Client.get_server``" msgstr "" #: ../../migrating.rst:67 msgid ":meth:`Client.get_guild`" msgstr "" #: ../../migrating.rst:69 msgid "``Emoji.server``" msgstr "" #: ../../migrating.rst:69 msgid ":attr:`Emoji.guild`" msgstr "" #: ../../migrating.rst:71 msgid "``Role.server``" msgstr "" #: ../../migrating.rst:71 msgid ":attr:`Role.guild`" msgstr "" #: ../../migrating.rst:73 msgid "``Invite.server``" msgstr "" #: ../../migrating.rst:73 msgid ":attr:`Invite.guild`" msgstr "" #: ../../migrating.rst:75 msgid "``Member.server``" msgstr "" #: ../../migrating.rst:75 msgid ":attr:`Member.guild`" msgstr "" #: ../../migrating.rst:77 msgid "``Permissions.manage_server``" msgstr "" #: ../../migrating.rst:77 msgid ":attr:`Permissions.manage_guild`" msgstr "" #: ../../migrating.rst:79 msgid "``VoiceClient.server``" msgstr "" #: ../../migrating.rst:79 msgid ":attr:`VoiceClient.guild`" msgstr "" #: ../../migrating.rst:81 msgid "``Client.create_server``" msgstr "" #: ../../migrating.rst:81 msgid ":meth:`Client.create_guild`" msgstr "" #: ../../migrating.rst:87 msgid "Models are Stateful" msgstr "" #: ../../migrating.rst:89 msgid "" "As mentioned earlier, a lot of functionality was moved out of " ":class:`Client` and put into their respective :ref:`model " "`." msgstr "" #: ../../migrating.rst:92 msgid "A list of these changes is enumerated below." msgstr "" #: ../../migrating.rst:97 msgid "``Client.add_reaction``" msgstr "" #: ../../migrating.rst:97 msgid ":meth:`Message.add_reaction`" msgstr "" #: ../../migrating.rst:99 msgid "``Client.add_roles``" msgstr "" #: ../../migrating.rst:99 msgid ":meth:`Member.add_roles`" msgstr "" #: ../../migrating.rst:101 msgid "``Client.ban``" msgstr "" #: ../../migrating.rst:101 msgid ":meth:`Member.ban` or :meth:`Guild.ban`" msgstr "" #: ../../migrating.rst:103 msgid "``Client.change_nickname``" msgstr "" #: ../../migrating.rst:103 ../../migrating.rst:167 ../../migrating.rst:183 #: ../../migrating.rst:191 msgid ":meth:`Member.edit`" msgstr "" #: ../../migrating.rst:105 msgid "``Client.clear_reactions``" msgstr "" #: ../../migrating.rst:105 msgid ":meth:`Message.clear_reactions`" msgstr "" #: ../../migrating.rst:107 msgid "``Client.create_channel``" msgstr "" #: ../../migrating.rst:107 msgid ":meth:`Guild.create_text_channel` and :meth:`Guild.create_voice_channel`" msgstr "" #: ../../migrating.rst:109 msgid "``Client.create_custom_emoji``" msgstr "" #: ../../migrating.rst:109 msgid ":meth:`Guild.create_custom_emoji`" msgstr "" #: ../../migrating.rst:111 msgid "``Client.create_invite``" msgstr "" #: ../../migrating.rst:111 msgid ":meth:`abc.GuildChannel.create_invite`" msgstr "" #: ../../migrating.rst:113 msgid "``Client.create_role``" msgstr "" #: ../../migrating.rst:113 msgid ":meth:`Guild.create_role`" msgstr "" #: ../../migrating.rst:115 msgid "``Client.delete_channel``" msgstr "" #: ../../migrating.rst:115 msgid ":meth:`abc.GuildChannel.delete`" msgstr "" #: ../../migrating.rst:117 msgid "``Client.delete_channel_permissions``" msgstr "" #: ../../migrating.rst:117 msgid "" ":meth:`abc.GuildChannel.set_permissions` with ``overwrite`` set to " "``None``" msgstr "" #: ../../migrating.rst:119 msgid "``Client.delete_custom_emoji``" msgstr "" #: ../../migrating.rst:119 msgid ":meth:`Emoji.delete`" msgstr "" #: ../../migrating.rst:121 msgid "``Client.delete_invite``" msgstr "" #: ../../migrating.rst:121 msgid ":meth:`Invite.delete` or :meth:`Client.delete_invite`" msgstr "" #: ../../migrating.rst:123 msgid "``Client.delete_message``" msgstr "" #: ../../migrating.rst:123 msgid ":meth:`Message.delete`" msgstr "" #: ../../migrating.rst:125 msgid "``Client.delete_messages``" msgstr "" #: ../../migrating.rst:125 msgid ":meth:`TextChannel.delete_messages`" msgstr "" #: ../../migrating.rst:127 msgid "``Client.delete_role``" msgstr "" #: ../../migrating.rst:127 msgid ":meth:`Role.delete`" msgstr "" #: ../../migrating.rst:129 msgid "``Client.delete_server``" msgstr "" #: ../../migrating.rst:129 msgid ":meth:`Guild.delete`" msgstr "" #: ../../migrating.rst:131 msgid "``Client.edit_channel``" msgstr "" #: ../../migrating.rst:131 ../../migrating.rst:165 msgid ":meth:`TextChannel.edit` or :meth:`VoiceChannel.edit`" msgstr "" #: ../../migrating.rst:133 msgid "``Client.edit_channel_permissions``" msgstr "" #: ../../migrating.rst:133 msgid ":meth:`abc.GuildChannel.set_permissions`" msgstr "" #: ../../migrating.rst:135 msgid "``Client.edit_custom_emoji``" msgstr "" #: ../../migrating.rst:135 msgid ":meth:`Emoji.edit`" msgstr "" #: ../../migrating.rst:137 msgid "``Client.edit_message``" msgstr "" #: ../../migrating.rst:137 msgid ":meth:`Message.edit`" msgstr "" #: ../../migrating.rst:139 msgid "``Client.edit_profile``" msgstr "" #: ../../migrating.rst:139 msgid ":meth:`ClientUser.edit` (you get this from :attr:`Client.user`)" msgstr "" #: ../../migrating.rst:141 msgid "``Client.edit_role``" msgstr "" #: ../../migrating.rst:141 ../../migrating.rst:169 msgid ":meth:`Role.edit`" msgstr "" #: ../../migrating.rst:143 msgid "``Client.edit_server``" msgstr "" #: ../../migrating.rst:143 msgid ":meth:`Guild.edit`" msgstr "" #: ../../migrating.rst:145 msgid "``Client.estimate_pruned_members``" msgstr "" #: ../../migrating.rst:145 msgid ":meth:`Guild.estimate_pruned_members`" msgstr "" #: ../../migrating.rst:147 ../../migrating.rst:325 msgid "``Client.get_all_emojis``" msgstr "" #: ../../migrating.rst:147 msgid ":attr:`Client.emojis`" msgstr "" #: ../../migrating.rst:149 msgid "``Client.get_bans``" msgstr "" #: ../../migrating.rst:149 msgid ":meth:`Guild.bans`" msgstr "" #: ../../migrating.rst:151 msgid "``Client.get_message``" msgstr "" #: ../../migrating.rst:151 msgid ":meth:`abc.Messageable.get_message`" msgstr "" #: ../../migrating.rst:153 msgid "``Client.get_reaction_users``" msgstr "" #: ../../migrating.rst:153 ../../migrating.rst:480 msgid ":meth:`Reaction.users`" msgstr "" #: ../../migrating.rst:155 msgid "``Client.invites_from``" msgstr "" #: ../../migrating.rst:155 msgid ":meth:`abc.GuildChannel.invites` or :meth:`Guild.invites`" msgstr "" #: ../../migrating.rst:157 msgid "``Client.join_voice_channel``" msgstr "" #: ../../migrating.rst:157 msgid ":meth:`VoiceChannel.connect` (see :ref:`migrating_1_0_voice`)" msgstr "" #: ../../migrating.rst:159 msgid "``Client.kick``" msgstr "" #: ../../migrating.rst:159 msgid ":meth:`Guild.kick` or :meth:`Member.kick`" msgstr "" #: ../../migrating.rst:161 msgid "``Client.leave_server``" msgstr "" #: ../../migrating.rst:161 msgid ":meth:`Guild.leave`" msgstr "" #: ../../migrating.rst:163 msgid "``Client.logs_from``" msgstr "" #: ../../migrating.rst:163 msgid ":meth:`abc.Messageable.history` (see :ref:`migrating_1_0_async_iter`)" msgstr "" #: ../../migrating.rst:165 msgid "``Client.move_channel``" msgstr "" #: ../../migrating.rst:167 msgid "``Client.move_member``" msgstr "" #: ../../migrating.rst:169 msgid "``Client.move_role``" msgstr "" #: ../../migrating.rst:171 msgid "``Client.pin_message``" msgstr "" #: ../../migrating.rst:171 msgid ":meth:`Message.pin`" msgstr "" #: ../../migrating.rst:173 msgid "``Client.pins_from``" msgstr "" #: ../../migrating.rst:173 msgid ":meth:`abc.Messageable.pins`" msgstr "" #: ../../migrating.rst:175 msgid "``Client.prune_members``" msgstr "" #: ../../migrating.rst:175 msgid ":meth:`Guild.prune_members`" msgstr "" #: ../../migrating.rst:177 msgid "``Client.purge_from``" msgstr "" #: ../../migrating.rst:177 msgid ":meth:`TextChannel.purge`" msgstr "" #: ../../migrating.rst:179 msgid "``Client.remove_reaction``" msgstr "" #: ../../migrating.rst:179 msgid ":meth:`Message.remove_reaction`" msgstr "" #: ../../migrating.rst:181 msgid "``Client.remove_roles``" msgstr "" #: ../../migrating.rst:181 msgid ":meth:`Member.remove_roles`" msgstr "" #: ../../migrating.rst:183 msgid "``Client.replace_roles``" msgstr "" #: ../../migrating.rst:185 msgid "``Client.send_file``" msgstr "" #: ../../migrating.rst:185 ../../migrating.rst:187 msgid ":meth:`abc.Messageable.send` (see :ref:`migrating_1_0_sending_messages`)" msgstr "" #: ../../migrating.rst:187 msgid "``Client.send_message``" msgstr "" #: ../../migrating.rst:189 msgid "``Client.send_typing``" msgstr "" #: ../../migrating.rst:189 msgid "" ":meth:`abc.Messageable.trigger_typing` (use " ":meth:`abc.Messageable.typing`)" msgstr "" #: ../../migrating.rst:191 msgid "``Client.server_voice_state``" msgstr "" #: ../../migrating.rst:193 msgid "``Client.start_private_message``" msgstr "" #: ../../migrating.rst:193 msgid ":meth:`User.create_dm`" msgstr "" #: ../../migrating.rst:195 msgid "``Client.unban``" msgstr "" #: ../../migrating.rst:195 msgid ":meth:`Guild.unban` or :meth:`Member.unban`" msgstr "" #: ../../migrating.rst:197 msgid "``Client.unpin_message``" msgstr "" #: ../../migrating.rst:197 msgid ":meth:`Message.unpin`" msgstr "" #: ../../migrating.rst:199 msgid "``Client.wait_for_message``" msgstr "" #: ../../migrating.rst:199 ../../migrating.rst:201 msgid ":meth:`Client.wait_for` (see :ref:`migrating_1_0_wait_for`)" msgstr "" #: ../../migrating.rst:201 msgid "``Client.wait_for_reaction``" msgstr "" #: ../../migrating.rst:203 msgid "``Client.wait_until_login``" msgstr "" #: ../../migrating.rst:203 ../../migrating.rst:205 msgid "Removed" msgstr "" #: ../../migrating.rst:205 msgid "``Client.messages``" msgstr "" #: ../../migrating.rst:207 msgid "``Client.wait_until_ready``" msgstr "" #: ../../migrating.rst:207 msgid "No change" msgstr "" #: ../../migrating.rst:211 msgid "Property Changes" msgstr "" #: ../../migrating.rst:213 msgid "" "In order to be a bit more consistent, certain things that were properties" " were changed to methods instead." msgstr "" #: ../../migrating.rst:215 msgid "" "The following are now methods instead of properties (requires " "parentheses):" msgstr "" #: ../../migrating.rst:217 msgid ":meth:`Role.is_default`" msgstr "" #: ../../migrating.rst:218 msgid ":meth:`Client.is_ready`" msgstr "" #: ../../migrating.rst:219 msgid ":meth:`Client.is_closed`" msgstr "" #: ../../migrating.rst:222 msgid "Dict Value Change" msgstr "" #: ../../migrating.rst:224 msgid "" "Prior to v1.0 some aggregating properties that retrieved models would " "return \"dict view\" objects." msgstr "" #: ../../migrating.rst:226 msgid "" "As a consequence, when the dict would change size while you would iterate" " over it, a RuntimeError would be raised and crash the task. To alleviate" " this, the \"dict view\" objects were changed into lists." msgstr "" #: ../../migrating.rst:229 msgid "The following views were changed to a list:" msgstr "" #: ../../migrating.rst:232 msgid ":attr:`Client.users` (new in v1.0)" msgstr "" #: ../../migrating.rst:233 msgid ":attr:`Client.emojis` (new in v1.0)" msgstr "" #: ../../migrating.rst:234 msgid ":attr:`Guild.channels`" msgstr "" #: ../../migrating.rst:235 msgid ":attr:`Guild.text_channels` (new in v1.0)" msgstr "" #: ../../migrating.rst:236 msgid ":attr:`Guild.voice_channels` (new in v1.0)" msgstr "" #: ../../migrating.rst:237 msgid ":attr:`Guild.emojis`" msgstr "" #: ../../migrating.rst:238 msgid ":attr:`Guild.members`" msgstr "" #: ../../migrating.rst:241 msgid "Voice State Changes" msgstr "" #: ../../migrating.rst:243 msgid "" "Earlier, in v0.11.0 a :class:`VoiceState` class was added to refer to " "voice states along with a :attr:`Member.voice` attribute to refer to it." msgstr "" #: ../../migrating.rst:246 msgid "" "However, it was transparent to the user. In an effort to make the library" " save more memory, the voice state change is now more visible." msgstr "" #: ../../migrating.rst:249 msgid "" "The only way to access voice attributes is via the :attr:`Member.voice` " "attribute. Note that if the member does not have a voice state this " "attribute can be ``None``." msgstr "" #: ../../migrating.rst:265 msgid "User and Member Type Split" msgstr "" #: ../../migrating.rst:267 msgid "" "In v1.0 to save memory, :class:`User` and :class:`Member` are no longer " "inherited. Instead, they are \"flattened\" by having equivalent " "properties that map out to the functional underlying :class:`User`. Thus," " there is no functional change in how they are used. However this breaks " "``isinstance`` checks and thus is something to keep in mind." msgstr "" #: ../../migrating.rst:271 msgid "" "These memory savings were accomplished by having a global :class:`User` " "cache, and as a positive consequence you can now easily fetch a " ":class:`User` by their ID by using the new :meth:`Client.get_user`. You " "can also get a list of all :class:`User` your client can see with " ":attr:`Client.users`." msgstr "" #: ../../migrating.rst:278 msgid "Channel Type Split" msgstr "" #: ../../migrating.rst:280 msgid "" "Prior to v1.0, channels were two different types, ``Channel`` and " "``PrivateChannel`` with a ``is_private`` property to help differentiate " "between them." msgstr "" #: ../../migrating.rst:283 msgid "" "In order to save memory the channels have been split into 4 different " "types:" msgstr "" #: ../../migrating.rst:285 msgid ":class:`TextChannel` for guild text channels." msgstr "" #: ../../migrating.rst:286 msgid ":class:`VoiceChannel` for guild voice channels." msgstr "" #: ../../migrating.rst:287 msgid ":class:`DMChannel` for DM channels with members." msgstr "" #: ../../migrating.rst:288 msgid ":class:`GroupChannel` for Group DM channels with members." msgstr "" #: ../../migrating.rst:290 msgid "" "With this split came the removal of the ``is_private`` attribute. You " "should now use ``isinstance``." msgstr "" #: ../../migrating.rst:292 msgid "The types are split into two different :ref:`discord_api_abcs`:" msgstr "" #: ../../migrating.rst:294 msgid ":class:`abc.GuildChannel` for guild channels." msgstr "" #: ../../migrating.rst:295 msgid ":class:`abc.PrivateChannel` for private channels (DMs and group DMs)." msgstr "" #: ../../migrating.rst:297 msgid "So to check if something is a guild channel you would do: ::" msgstr "" #: ../../migrating.rst:301 msgid "And to check if it's a private channel you would do: ::" msgstr "" #: ../../migrating.rst:305 msgid "" "Of course, if you're looking for only a specific type you can pass that " "too, e.g. ::" msgstr "" #: ../../migrating.rst:309 msgid "" "With this type split also came event changes, which are enumerated in " ":ref:`migrating_1_0_event_changes`." msgstr "" #: ../../migrating.rst:313 msgid "Miscellaneous Model Changes" msgstr "" #: ../../migrating.rst:315 msgid "There were lots of other things added or removed in the models in general." msgstr "" #: ../../migrating.rst:317 msgid "They will be enumerated here." msgstr "" #: ../../migrating.rst:319 msgid "**Removed**" msgstr "" #: ../../migrating.rst:321 msgid ":meth:`Client.login` no longer accepts email and password logins." msgstr "" #: ../../migrating.rst:323 msgid "Use a token and ``bot=False``." msgstr "" #: ../../migrating.rst:327 msgid "Use :attr:`Client.emojis` instead." msgstr "" #: ../../migrating.rst:329 msgid "``Client.wait_for_message`` and ``Client.wait_for_reaction`` are gone." msgstr "" #: ../../migrating.rst:331 msgid "Use :meth:`Client.wait_for` instead." msgstr "" #: ../../migrating.rst:333 msgid "``Channel.voice_members``" msgstr "" #: ../../migrating.rst:335 msgid "Use :attr:`VoiceChannel.members` instead." msgstr "" #: ../../migrating.rst:337 msgid "``Channel.is_private``" msgstr "" #: ../../migrating.rst:339 msgid "" "Use ``isinstance`` instead with one of the :ref:`discord_api_abcs` " "instead." msgstr "" #: ../../migrating.rst:340 msgid "" "e.g. ``isinstance(channel, discord.abc.GuildChannel)`` will check if it " "isn't a private channel." msgstr "" #: ../../migrating.rst:342 msgid "``Client.accept_invite``" msgstr "" #: ../../migrating.rst:344 msgid "" "There is no replacement for this one. This functionality is deprecated " "API wise." msgstr "" #: ../../migrating.rst:346 msgid "" "``Guild.default_channel`` / ``Server.default_channel`` and " "``Channel.is_default``" msgstr "" #: ../../migrating.rst:348 msgid "" "The concept of a default channel was removed from Discord. See `#329 " "`_." msgstr "" #: ../../migrating.rst:351 msgid "``Message.edited_timestamp``" msgstr "" #: ../../migrating.rst:353 msgid "Use :attr:`Message.edited_at` instead." msgstr "" #: ../../migrating.rst:355 msgid "``Message.timestamp``" msgstr "" #: ../../migrating.rst:357 msgid "Use :attr:`Message.created_at` instead." msgstr "" #: ../../migrating.rst:359 msgid "``Colour.to_tuple()``" msgstr "" #: ../../migrating.rst:361 msgid "Use :meth:`Colour.to_rgb` instead." msgstr "" #: ../../migrating.rst:363 msgid "``Permissions.view_audit_logs``" msgstr "" #: ../../migrating.rst:365 msgid "Use :attr:`Permissions.view_audit_log` instead." msgstr "" #: ../../migrating.rst:367 msgid "``Member.game``" msgstr "" #: ../../migrating.rst:369 msgid "Use :attr:`Member.activity` instead." msgstr "" #: ../../migrating.rst:371 msgid "**Changed**" msgstr "" #: ../../migrating.rst:373 msgid "" ":attr:`Member.avatar_url` and :attr:`User.avatar_url` now return the " "default avatar if a custom one is not set." msgstr "" #: ../../migrating.rst:374 msgid "" ":attr:`Message.embeds` is now a list of :class:`Embed` instead of " "``dict`` objects." msgstr "" #: ../../migrating.rst:375 msgid "" ":attr:`Message.attachments` is now a list of :class:`Attachment` instead " "of ``dict`` object." msgstr "" #: ../../migrating.rst:377 msgid "**Added**" msgstr "" #: ../../migrating.rst:379 msgid ":class:`Attachment` to represent a discord attachment." msgstr "" #: ../../migrating.rst:380 msgid ":class:`CategoryChannel` to represent a channel category." msgstr "" #: ../../migrating.rst:381 msgid "" ":attr:`VoiceChannel.members` for fetching members connected to a voice " "channel." msgstr "" #: ../../migrating.rst:382 msgid ":attr:`TextChannel.members` for fetching members that can see the channel." msgstr "" #: ../../migrating.rst:383 msgid ":attr:`Role.members` for fetching members that have the role." msgstr "" #: ../../migrating.rst:384 msgid ":attr:`Guild.text_channels` for fetching text channels only." msgstr "" #: ../../migrating.rst:385 msgid ":attr:`Guild.voice_channels` for fetching voice channels only." msgstr "" #: ../../migrating.rst:386 msgid ":attr:`Guild.categories` for fetching channel categories only." msgstr "" #: ../../migrating.rst:387 msgid "" ":attr:`TextChannel.category` and :attr:`VoiceChannel.category` to get the" " category a channel belongs to." msgstr "" #: ../../migrating.rst:388 msgid ":meth:`Guild.by_category` to get channels grouped by their category." msgstr "" #: ../../migrating.rst:389 msgid ":attr:`Guild.chunked` to check member chunking status." msgstr "" #: ../../migrating.rst:390 msgid ":attr:`Guild.explicit_content_filter` to fetch the content filter." msgstr "" #: ../../migrating.rst:391 msgid ":attr:`Guild.shard_id` to get a guild's Shard ID if you're sharding." msgstr "" #: ../../migrating.rst:392 msgid ":attr:`Client.users` to get all visible :class:`User` instances." msgstr "" #: ../../migrating.rst:393 msgid ":meth:`Client.get_user` to get a :class:`User` by ID." msgstr "" #: ../../migrating.rst:394 msgid ":meth:`User.avatar_url_as` to get an avatar in a specific size or format." msgstr "" #: ../../migrating.rst:395 msgid ":meth:`Guild.vanity_invite` to fetch the guild's vanity invite." msgstr "" #: ../../migrating.rst:396 msgid ":meth:`Guild.audit_logs` to fetch the guild's audit logs." msgstr "" #: ../../migrating.rst:397 msgid ":attr:`Message.webhook_id` to fetch the message's webhook ID." msgstr "" #: ../../migrating.rst:398 msgid "" ":attr:`Message.activity` and :attr:`Message.application` for Rich " "Presence related information." msgstr "" #: ../../migrating.rst:399 msgid ":meth:`TextChannel.is_nsfw` to check if a text channel is NSFW." msgstr "" #: ../../migrating.rst:400 msgid ":meth:`Colour.from_rgb` to construct a :class:`Colour` from RGB tuple." msgstr "" #: ../../migrating.rst:405 msgid "Sending Messages" msgstr "" #: ../../migrating.rst:407 msgid "" "One of the changes that were done was the merger of the previous " "``Client.send_message`` and ``Client.send_file`` functionality into a " "single method, :meth:`~abc.Messageable.send`." msgstr "" #: ../../migrating.rst:410 ../../migrating.rst:990 msgid "Basically: ::" msgstr "" #: ../../migrating.rst:418 msgid "" "This supports everything that the old ``send_message`` supported such as " "embeds: ::" msgstr "" #: ../../migrating.rst:423 msgid "" "There is a caveat with sending files however, as this functionality was " "expanded to support multiple file attachments, you must now use a " ":class:`File` pseudo-namedtuple to upload a single file. ::" msgstr "" #: ../../migrating.rst:432 msgid "This change was to facilitate multiple file uploads: ::" msgstr "" #: ../../migrating.rst:444 msgid "Asynchronous Iterators" msgstr "" #: ../../migrating.rst:446 msgid "" "Prior to v1.0, certain functions like ``Client.logs_from`` would return a" " different type if done in Python 3.4 or 3.5+." msgstr "" #: ../../migrating.rst:448 msgid "" "In v1.0, this change has been reverted and will now return a singular " "type meeting an abstract concept called :class:`AsyncIterator`." msgstr "" #: ../../migrating.rst:451 msgid "This allows you to iterate over it like normal: ::" msgstr "" #: ../../migrating.rst:456 msgid "Or turn it into a list: ::" msgstr "" #: ../../migrating.rst:462 msgid "" "A handy aspect of returning :class:`AsyncIterator` is that it allows you " "to chain functions together such as :meth:`AsyncIterator.map` or " ":meth:`AsyncIterator.filter`: ::" msgstr "" #: ../../migrating.rst:468 msgid "" "The functions passed to :meth:`AsyncIterator.map` or " ":meth:`AsyncIterator.filter` can be either coroutines or regular " "functions." msgstr "" #: ../../migrating.rst:471 msgid "" "You can also get single elements a la :func:`discord.utils.find` or " ":func:`discord.utils.get` via :meth:`AsyncIterator.get` or " ":meth:`AsyncIterator.find`: ::" msgstr "" #: ../../migrating.rst:476 msgid "The following return :class:`AsyncIterator`:" msgstr "" #: ../../migrating.rst:478 msgid ":meth:`abc.Messageable.history`" msgstr "" #: ../../migrating.rst:479 msgid ":meth:`Guild.audit_logs`" msgstr "" #: ../../migrating.rst:485 ../../migrating.rst:907 msgid "Event Changes" msgstr "" #: ../../migrating.rst:487 msgid "A lot of events have gone through some changes." msgstr "" #: ../../migrating.rst:489 msgid "" "Many events with ``server`` in the name were changed to use ``guild`` " "instead." msgstr "" #: ../../migrating.rst:491 ../../migrating.rst:555 msgid "Before:" msgstr "" #: ../../migrating.rst:493 msgid "``on_server_join``" msgstr "" #: ../../migrating.rst:494 msgid "``on_server_remove``" msgstr "" #: ../../migrating.rst:495 msgid "``on_server_update``" msgstr "" #: ../../migrating.rst:496 msgid "``on_server_role_create``" msgstr "" #: ../../migrating.rst:497 msgid "``on_server_role_delete``" msgstr "" #: ../../migrating.rst:498 msgid "``on_server_role_update``" msgstr "" #: ../../migrating.rst:499 msgid "``on_server_emojis_update``" msgstr "" #: ../../migrating.rst:500 msgid "``on_server_available``" msgstr "" #: ../../migrating.rst:501 msgid "``on_server_unavailable``" msgstr "" #: ../../migrating.rst:503 ../../migrating.rst:561 msgid "After:" msgstr "" #: ../../migrating.rst:505 msgid ":func:`on_guild_join`" msgstr "" #: ../../migrating.rst:506 msgid ":func:`on_guild_remove`" msgstr "" #: ../../migrating.rst:507 msgid ":func:`on_guild_update`" msgstr "" #: ../../migrating.rst:508 msgid ":func:`on_guild_role_create`" msgstr "" #: ../../migrating.rst:509 msgid ":func:`on_guild_role_delete`" msgstr "" #: ../../migrating.rst:510 msgid ":func:`on_guild_role_update`" msgstr "" #: ../../migrating.rst:511 msgid ":func:`on_guild_emojis_update`" msgstr "" #: ../../migrating.rst:512 msgid ":func:`on_guild_available`" msgstr "" #: ../../migrating.rst:513 msgid ":func:`on_guild_unavailable`" msgstr "" #: ../../migrating.rst:516 msgid "The :func:`on_voice_state_update` event has received an argument change." msgstr "" #: ../../migrating.rst:518 ../../migrating.rst:530 ../../migrating.rst:542 #: ../../migrating.rst:602 ../../migrating.rst:911 msgid "Before: ::" msgstr "" #: ../../migrating.rst:522 ../../migrating.rst:534 ../../migrating.rst:546 #: ../../migrating.rst:614 ../../migrating.rst:917 ../../migrating.rst:1070 msgid "After: ::" msgstr "" #: ../../migrating.rst:526 msgid "" "Instead of two :class:`Member` objects, the new event takes one " ":class:`Member` object and two :class:`VoiceState` objects." msgstr "" #: ../../migrating.rst:528 msgid "The :func:`on_guild_emojis_update` event has received an argument change." msgstr "" #: ../../migrating.rst:538 msgid "" "The first argument is now the :class:`Guild` that the emojis were updated" " from." msgstr "" #: ../../migrating.rst:540 msgid "The :func:`on_member_ban` event has received an argument change as well:" msgstr "" #: ../../migrating.rst:550 msgid "" "As part of the change, the event can either receive a :class:`User` or " ":class:`Member`. To help in the cases that have :class:`User`, the " ":class:`Guild` is provided as the first parameter." msgstr "" #: ../../migrating.rst:553 msgid "" "The ``on_channel_`` events have received a type level split (see " ":ref:`migrating_1_0_channel_split`)." msgstr "" #: ../../migrating.rst:557 msgid "``on_channel_delete``" msgstr "" #: ../../migrating.rst:558 msgid "``on_channel_create``" msgstr "" #: ../../migrating.rst:559 msgid "``on_channel_update``" msgstr "" #: ../../migrating.rst:563 msgid ":func:`on_guild_channel_delete`" msgstr "" #: ../../migrating.rst:564 msgid ":func:`on_guild_channel_create`" msgstr "" #: ../../migrating.rst:565 msgid ":func:`on_guild_channel_update`" msgstr "" #: ../../migrating.rst:566 msgid ":func:`on_private_channel_delete`" msgstr "" #: ../../migrating.rst:567 msgid ":func:`on_private_channel_create`" msgstr "" #: ../../migrating.rst:568 msgid ":func:`on_private_channel_update`" msgstr "" #: ../../migrating.rst:570 msgid "" "The ``on_guild_channel_`` events correspond to :class:`abc.GuildChannel` " "being updated (i.e. :class:`TextChannel` and :class:`VoiceChannel`) and " "the ``on_private_channel_`` events correspond to " ":class:`abc.PrivateChannel` being updated (i.e. :class:`DMChannel` and " ":class:`GroupChannel`)." msgstr "" #: ../../migrating.rst:577 msgid "Voice Changes" msgstr "" #: ../../migrating.rst:579 msgid "Voice sending has gone through a complete redesign." msgstr "" #: ../../migrating.rst:581 msgid "In particular:" msgstr "" #: ../../migrating.rst:583 msgid "" "Connection is done through :meth:`VoiceChannel.connect` instead of " "``Client.join_voice_channel``." msgstr "" #: ../../migrating.rst:584 msgid "" "You no longer create players and operate on them (you no longer store " "them)." msgstr "" #: ../../migrating.rst:585 msgid "" "You instead request :class:`VoiceClient` to play an :class:`AudioSource` " "via :meth:`VoiceClient.play`." msgstr "" #: ../../migrating.rst:586 msgid "There are different built-in :class:`AudioSource`\\s." msgstr "" #: ../../migrating.rst:588 msgid ":class:`FFmpegPCMAudio` is the equivalent of ``create_ffmpeg_player``" msgstr "" #: ../../migrating.rst:590 msgid "" "create_ffmpeg_player/create_stream_player/create_ytdl_player have all " "been removed." msgstr "" #: ../../migrating.rst:592 msgid "The goal is to create :class:`AudioSource` instead." msgstr "" #: ../../migrating.rst:594 msgid "Using :meth:`VoiceClient.play` will not return an ``AudioPlayer``." msgstr "" #: ../../migrating.rst:596 msgid "Instead, it's \"flattened\" like :class:`User` -> :class:`Member` is." msgstr "" #: ../../migrating.rst:598 msgid "The ``after`` parameter now takes a single parameter (the error)." msgstr "" #: ../../migrating.rst:600 msgid "Basically:" msgstr "" #: ../../migrating.rst:624 msgid "" "With the changed :class:`AudioSource` design, you can now change the " "source that the :class:`VoiceClient` is playing at runtime via " ":attr:`VoiceClient.source`." msgstr "" #: ../../migrating.rst:627 msgid "" "For example, you can add a :class:`PCMVolumeTransformer` to allow " "changing the volume: ::" msgstr "" #: ../../migrating.rst:632 msgid "" "An added benefit of the redesign is that it will be much more resilient " "towards reconnections:" msgstr "" #: ../../migrating.rst:634 msgid "" "The voice websocket will now automatically re-connect and re-do the " "handshake when disconnected." msgstr "" #: ../../migrating.rst:635 msgid "" "The initial connect handshake will now retry up to 5 times so you no " "longer get as many ``asyncio.TimeoutError``." msgstr "" #: ../../migrating.rst:636 msgid "Audio will now stop and resume when a disconnect is found." msgstr "" #: ../../migrating.rst:638 msgid "This includes changing voice regions etc." msgstr "" #: ../../migrating.rst:644 msgid "Waiting For Events" msgstr "" #: ../../migrating.rst:646 msgid "" "Prior to v1.0, the machinery for waiting for an event outside of the " "event itself was done through two different functions, " "``Client.wait_for_message`` and ``Client.wait_for_reaction``. One problem" " with one such approach is that it did not allow you to wait for events " "outside of the ones provided by the library." msgstr "" #: ../../migrating.rst:650 msgid "" "In v1.0 the concept of waiting for another event has been generalised to " "work with any event as :meth:`Client.wait_for`." msgstr "" #: ../../migrating.rst:652 msgid "For example, to wait for a message: ::" msgstr "" #: ../../migrating.rst:663 msgid "" "To facilitate multiple returns, :meth:`Client.wait_for` returns either a " "single argument, no arguments, or a tuple of arguments." msgstr "" #: ../../migrating.rst:666 msgid "For example, to wait for a reaction: ::" msgstr "" #: ../../migrating.rst:672 msgid "" "Since this function now can return multiple arguments, the ``timeout`` " "parameter will now raise a :exc:`asyncio.TimeoutError` when reached " "instead of setting the return to ``None``. For example:" msgstr "" #: ../../migrating.rst:689 msgid "Upgraded Dependencies" msgstr "" #: ../../migrating.rst:691 msgid "" "Following v1.0 of the library, we've updated our requirements to " "``aiohttp`` v2.0 or higher." msgstr "" #: ../../migrating.rst:693 msgid "" "Since this is a backwards incompatible change, it is recommended that you" " see the `changes " "`_ " "and the `migrating " "`_ pages for " "details on the breaking changes in ``aiohttp``." msgstr "" #: ../../migrating.rst:698 msgid "" "Of the most significant for common users is the removal of helper " "functions such as:" msgstr "" #: ../../migrating.rst:700 msgid "``aiohttp.get``" msgstr "" #: ../../migrating.rst:701 msgid "``aiohttp.post``" msgstr "" #: ../../migrating.rst:702 msgid "``aiohttp.delete``" msgstr "" #: ../../migrating.rst:703 msgid "``aiohttp.patch``" msgstr "" #: ../../migrating.rst:704 msgid "``aiohttp.head``" msgstr "" #: ../../migrating.rst:705 msgid "``aiohttp.put``" msgstr "" #: ../../migrating.rst:706 msgid "``aiohttp.request``" msgstr "" #: ../../migrating.rst:708 msgid "It is recommended that you create a session instead: ::" msgstr "" #: ../../migrating.rst:714 msgid "" "Since it is better to not create a session for every request, you should " "store it in a variable and then call ``session.close`` on it when it " "needs to be disposed." msgstr "" #: ../../migrating.rst:718 msgid "Sharding" msgstr "" #: ../../migrating.rst:720 msgid "" "The library has received significant changes on how it handles sharding " "and now has sharding as a first-class citizen." msgstr "" #: ../../migrating.rst:722 msgid "" "If using a Bot account and you want to shard your bot in a single process" " then you can use the :class:`AutoShardedClient`." msgstr "" #: ../../migrating.rst:724 msgid "" "This class allows you to use sharding without having to launch multiple " "processes or deal with complicated IPC." msgstr "" #: ../../migrating.rst:726 msgid "" "It should be noted that **the sharded client does not support user " "accounts**. This is due to the changes in connection logic and state " "handling." msgstr "" #: ../../migrating.rst:729 msgid "Usage is as simple as doing: ::" msgstr "" #: ../../migrating.rst:733 msgid "instead of using :class:`Client`." msgstr "" #: ../../migrating.rst:735 msgid "" "This will launch as many shards as your bot needs using the " "``/gateway/bot`` endpoint, which allocates about 1000 guilds per shard." msgstr "" #: ../../migrating.rst:738 msgid "" "If you want more control over the sharding you can specify " "``shard_count`` and ``shard_ids``. ::" msgstr "" #: ../../migrating.rst:746 msgid "" "For users of the command extension, there is also " ":class:`~ext.commands.AutoShardedBot` which behaves similarly." msgstr "" #: ../../migrating.rst:749 msgid "Connection Improvements" msgstr "" #: ../../migrating.rst:751 msgid "In v1.0, the auto reconnection logic has been powered up significantly." msgstr "" #: ../../migrating.rst:753 msgid "" ":meth:`Client.connect` has gained a new keyword argument, ``reconnect`` " "that defaults to ``True`` which controls the reconnect logic. When " "enabled, the client will automatically reconnect in all instances of your" " internet going offline or Discord going offline with exponential back-" "off." msgstr "" #: ../../migrating.rst:757 msgid "" ":meth:`Client.run` and :meth:`Client.start` gains this keyword argument " "as well, but for most cases you will not need to specify it unless " "turning it off." msgstr "" #: ../../migrating.rst:763 msgid "Command Extension Changes" msgstr "" #: ../../migrating.rst:765 msgid "" "Due to the :ref:`migrating_1_0_model_state` changes, some of the design " "of the extension module had to undergo some design changes as well." msgstr "" #: ../../migrating.rst:769 msgid "Context Changes" msgstr "" #: ../../migrating.rst:771 msgid "" "In v1.0, the :class:`.Context` has received a lot of changes with how " "it's retrieved and used." msgstr "" #: ../../migrating.rst:773 msgid "" "The biggest change is that ``pass_context=True`` no longer exists, " ":class:`.Context` is always passed. Ergo:" msgstr "" #: ../../migrating.rst:787 msgid "" "The reason for this is because :class:`~ext.commands.Context` now meets " "the requirements of :class:`abc.Messageable`. This makes it have similar " "functionality to :class:`TextChannel` or :class:`DMChannel`. Using " ":meth:`~.Context.send` will either DM the user in a DM context or send a " "message in the channel it was in, similar to the old ``bot.say`` " "functionality. The old helpers have been removed in favour of the new " ":class:`abc.Messageable` interface. See " ":ref:`migrating_1_0_removed_helpers` for more information." msgstr "" #: ../../migrating.rst:793 msgid "" "Since the :class:`~ext.commands.Context` is now by default passed, " "several shortcuts have been added:" msgstr "" #: ../../migrating.rst:795 msgid "**New Shortcuts**" msgstr "" #: ../../migrating.rst:797 msgid "" ":attr:`~ext.commands.Context.author` is a shortcut for " "``ctx.message.author``." msgstr "" #: ../../migrating.rst:798 msgid "" ":attr:`~ext.commands.Context.guild` is a shortcut for " "``ctx.message.guild``." msgstr "" #: ../../migrating.rst:799 msgid "" ":attr:`~ext.commands.Context.channel` is a shortcut for " "``ctx.message.channel``." msgstr "" #: ../../migrating.rst:800 msgid "" ":attr:`~ext.commands.Context.me` is a shortcut for " "``ctx.message.guild.me`` or ``ctx.bot.user``." msgstr "" #: ../../migrating.rst:801 msgid "" ":attr:`~ext.commands.Context.voice_client` is a shortcut for " "``ctx.message.guild.voice_client``." msgstr "" #: ../../migrating.rst:803 msgid "**New Functionality**" msgstr "" #: ../../migrating.rst:805 msgid ":meth:`~.Context.reinvoke` to invoke a command again." msgstr "" #: ../../migrating.rst:807 msgid "This is useful for bypassing cooldowns." msgstr "" #: ../../migrating.rst:810 msgid "Subclassing Context" msgstr "" #: ../../migrating.rst:812 msgid "" "In v1.0, there is now the ability to subclass " ":class:`~ext.commands.Context` and use it instead of the default provided" " one." msgstr "" #: ../../migrating.rst:815 msgid "For example, if you want to add some functionality to the context:" msgstr "" #: ../../migrating.rst:824 msgid "" "Then you can use :meth:`~ext.commands.Bot.get_context` inside " ":func:`on_message` with combination with :meth:`~ext.commands.Bot.invoke`" " to use your custom context:" msgstr "" #: ../../migrating.rst:834 msgid "Now inside your commands you will have access to your custom context:" msgstr "" #: ../../migrating.rst:845 msgid "Removed Helpers" msgstr "" #: ../../migrating.rst:847 msgid "" "With the new :class:`.Context` changes, a lot of message sending helpers " "have been removed." msgstr "" #: ../../migrating.rst:849 msgid "For a full list of changes, see below:" msgstr "" #: ../../migrating.rst:854 msgid "``Bot.say``" msgstr "" #: ../../migrating.rst:854 ../../migrating.rst:856 msgid ":meth:`.Context.send`" msgstr "" #: ../../migrating.rst:856 msgid "``Bot.upload``" msgstr "" #: ../../migrating.rst:858 msgid "``Bot.whisper``" msgstr "" #: ../../migrating.rst:858 msgid "``ctx.author.send``" msgstr "" #: ../../migrating.rst:860 msgid "``Bot.type``" msgstr "" #: ../../migrating.rst:860 msgid ":meth:`.Context.typing` or :meth:`.Context.trigger_typing`" msgstr "" #: ../../migrating.rst:862 msgid "``Bot.reply``" msgstr "" #: ../../migrating.rst:862 msgid "No replacement." msgstr "" #: ../../migrating.rst:866 msgid "Command Changes" msgstr "" #: ../../migrating.rst:868 msgid "" "As mentioned earlier, the first command change is that " "``pass_context=True`` no longer exists, so there is no need to pass this " "as a parameter." msgstr "" #: ../../migrating.rst:871 msgid "" "Another change is the removal of ``no_pm=True``. Instead, use the new " ":func:`~ext.commands.guild_only` built-in check." msgstr "" #: ../../migrating.rst:874 msgid "" "The ``commands`` attribute of :class:`~ext.commands.Bot` and " ":class:`~ext.commands.Group` have been changed from a dictionary to a set" " that does not have aliases. To retrieve the previous dictionary " "behaviour, use ``all_commands`` instead." msgstr "" #: ../../migrating.rst:877 msgid "Command instances have gained new attributes and properties:" msgstr "" #: ../../migrating.rst:879 msgid "" ":attr:`~ext.commands.Command.signature` to get the signature of the " "command." msgstr "" #: ../../migrating.rst:880 msgid ":attr:`~.Command.usage`, an attribute to override the default signature." msgstr "" #: ../../migrating.rst:881 msgid "" ":attr:`~.Command.root_parent` to get the root parent group of a " "subcommand." msgstr "" #: ../../migrating.rst:883 msgid "" "For :class:`~ext.commands.Group` and :class:`~ext.commands.Bot` the " "following changed:" msgstr "" #: ../../migrating.rst:885 msgid "Changed :attr:`~.GroupMixin.commands` to be a ``set`` without aliases." msgstr "" #: ../../migrating.rst:887 msgid "" "Use :attr:`~.GroupMixin.all_commands` to get the old ``dict`` with all " "commands." msgstr "" #: ../../migrating.rst:890 msgid "Check Changes" msgstr "" #: ../../migrating.rst:892 msgid "" "Prior to v1.0, :func:`~ext.commands.check`\\s could only be synchronous. " "As of v1.0 checks can now be coroutines." msgstr "" #: ../../migrating.rst:894 msgid "Along with this change, a couple new checks were added." msgstr "" #: ../../migrating.rst:896 msgid "" ":func:`~ext.commands.guild_only` replaces the old ``no_pm=True`` " "functionality." msgstr "" #: ../../migrating.rst:897 msgid "" ":func:`~ext.commands.is_owner` uses the :meth:`Client.application_info` " "endpoint by default to fetch owner ID." msgstr "" #: ../../migrating.rst:899 msgid "" "This is actually powered by a different function, " ":meth:`~ext.commands.Bot.is_owner`." msgstr "" #: ../../migrating.rst:900 msgid "You can set the owner ID yourself by setting :attr:`.Bot.owner_id`." msgstr "" #: ../../migrating.rst:902 msgid "" ":func:`~ext.commands.is_nsfw` checks if the channel the command is in is " "a NSFW channel." msgstr "" #: ../../migrating.rst:904 msgid "This is powered by the new :meth:`TextChannel.is_nsfw` method." msgstr "" #: ../../migrating.rst:909 msgid "All command extension events have changed." msgstr "" #: ../../migrating.rst:923 msgid "" "The extraneous ``command`` parameter in :func:`.on_command` and " ":func:`.on_command_completion` have been removed. The " ":class:`~ext.commands.Command` instance was not kept up-to date so it was" " incorrect. In order to get the up to date :class:`~ext.commands.Command`" " instance, use the :attr:`.Context.command` attribute." msgstr "" #: ../../migrating.rst:928 msgid "" "The error handlers, either :meth:`.Command.error` or " ":func:`.on_command_error`, have been re-ordered to use the " ":class:`~ext.commands.Context` as its first parameter to be consistent " "with other events and commands." msgstr "" #: ../../migrating.rst:933 msgid "Cog Changes" msgstr "" #: ../../migrating.rst:935 msgid "Cog special methods have changed slightly." msgstr "" #: ../../migrating.rst:937 msgid "" "The previous ``__check`` special method has been renamed to " "``__global_check`` to make it more clear that it's a global check." msgstr "" #: ../../migrating.rst:940 msgid "" "To complement the new ``__global_check`` there is now a new " "``__local_check`` to facilitate a check that will run on every command in" " the cog. There is also a ``__global_check_once``, which is similar to a " "global check instead it is only called once per :meth:`.Bot.invoke` call " "rather than every :meth:`.Command.invoke` call. Practically, the " "difference is only for black-listing users or channels without constantly" " opening a database connection." msgstr "" #: ../../migrating.rst:945 msgid "" "Cogs have also gained a ``__before_invoke`` and ``__after_invoke`` cog " "local before and after invocation hook, which can be seen in " ":ref:`migrating_1_0_before_after_hook`." msgstr "" #: ../../migrating.rst:948 msgid "" "The final addition is cog-local error handler, ``__error``, that is run " "on every command in the cog." msgstr "" #: ../../migrating.rst:950 msgid "An example cog with every special method registered is as follows: ::" msgstr "" #: ../../migrating.rst:981 msgid "Before and After Invocation Hooks" msgstr "" #: ../../migrating.rst:983 msgid "" "Commands have gained new before and after invocation hooks that allow you" " to do an action before and after a command is run." msgstr "" #: ../../migrating.rst:986 msgid "" "They take a single parameter, :class:`~ext.commands.Context` and they " "must be a coroutine." msgstr "" #: ../../migrating.rst:988 msgid "They are on a global, per-cog, or per-command basis." msgstr "" #: ../../migrating.rst:1005 msgid "" "The after invocation is hook always called, **regardless of an error in " "the command**. This makes it ideal for some error handling or clean up of" " certain resources such a database connection." msgstr "" #: ../../migrating.rst:1008 msgid "The per-command registration is as follows: ::" msgstr "" #: ../../migrating.rst:1024 msgid "" "The special cog method for these is ``__before_invoke`` and " "``__after_invoke``, e.g.: ::" msgstr "" #: ../../migrating.rst:1037 msgid "" "To check if a command failed in the after invocation hook, you can use " ":attr:`.Context.command_failed`." msgstr "" #: ../../migrating.rst:1040 msgid "The invocation order is as follows:" msgstr "" #: ../../migrating.rst:1042 msgid "Command local before invocation hook" msgstr "" #: ../../migrating.rst:1043 msgid "Cog local before invocation hook" msgstr "" #: ../../migrating.rst:1044 msgid "Global before invocation hook" msgstr "" #: ../../migrating.rst:1045 msgid "The actual command" msgstr "" #: ../../migrating.rst:1046 msgid "Command local after invocation hook" msgstr "" #: ../../migrating.rst:1047 msgid "Cog local after invocation hook" msgstr "" #: ../../migrating.rst:1048 msgid "Global after invocation hook" msgstr "" #: ../../migrating.rst:1051 msgid "Converter Changes" msgstr "" #: ../../migrating.rst:1053 msgid "" "Prior to v1.0, a converter was a type hint that could be a callable that " "could be invoked with a singular argument denoting the argument passed by" " the user as a string." msgstr "" #: ../../migrating.rst:1056 msgid "" "This system was eventually expanded to support a " ":class:`~ext.commands.Converter` system to allow plugging in the " ":class:`~ext.commands.Context` and do more complicated conversions such " "as the built-in \"discord\" converters." msgstr "" #: ../../migrating.rst:1060 msgid "" "In v1.0 this converter system was revamped to allow instances of " ":class:`~ext.commands.Converter` derived classes to be passed. For " "consistency, the :meth:`~ext.commands.Converter.convert` method was " "changed to always be a coroutine and will now take the two arguments as " "parameters." msgstr "" #: ../../migrating.rst:1064 msgid "Essentially, before: ::" msgstr "" #: ../../migrating.rst:1076 msgid "The command framework also got a couple new converters:" msgstr "" #: ../../migrating.rst:1078 msgid "" ":class:`~ext.commands.clean_content` this is akin to " ":attr:`Message.clean_content` which scrubs mentions." msgstr "" #: ../../migrating.rst:1079 msgid "" ":class:`~ext.commands.UserConverter` will now appropriately convert " ":class:`User` only." msgstr "" #: ../../migrating.rst:1080 msgid "``ChannelConverter`` is now split into two different converters." msgstr "" #: ../../migrating.rst:1082 msgid ":class:`~ext.commands.TextChannelConverter` for :class:`TextChannel`." msgstr "" #: ../../migrating.rst:1083 msgid ":class:`~ext.commands.VoiceChannelConverter` for :class:`VoiceChannel`." msgstr ""