msgid "One of the most appealing aspect of the command extension is how easy it is to define commands and how you can arbitrarily nest groups and commands to have a rich sub-command system."
"One of the most appealing aspect of the command extension is how easy it "
"is to define commands and how you can arbitrarily nest groups and "
msgid "Commands are defined by attaching it to a regular Python function. The command is then invoked by the user using a similar signature to the Python function."
"Commands are defined by attaching it to a regular Python function. The "
"command is then invoked by the user using a similar signature to the "
msgid "There are two ways of registering a command. The first one is by using :meth:`.Bot.command` decorator, as seen in the example above. The second is using the :func:`~ext.commands.command` decorator followed by :meth:`.Bot.add_command` on the instance."
"There are two ways of registering a command. The first one is by using "
msgid "Any parameter that is accepted by the :class:`.Command` constructor can be passed into the decorator. For example, to change the name to something other than the function would be as simple as doing this:"
"Any parameter that is accepted by the :class:`.Command` constructor can "
msgid "Sometimes you want users to pass in an undetermined number of parameters. The library supports this similar to how variable list parameters are done in Python:"
"Sometimes you want users to pass in an undetermined number of parameters."
" The library supports this similar to how variable list parameters are "
msgid "This allows our user to accept either one or many arguments as they please. This works similar to positional arguments, so multi-word parameters should be quoted."
"This allows our user to accept either one or many arguments as they "
"please. This works similar to positional arguments, so multi-word "
msgid "When you want to handle parsing of the argument yourself or do not feel like you want to wrap multi-word user input into quotes, you can ask the library to give you the rest as a single argument. We do this by using a **keyword-only argument**, seen below:"
"When you want to handle parsing of the argument yourself or do not feel "
"like you want to wrap multi-word user input into quotes, you can ask the "
"library to give you the rest as a single argument. We do this by using a "
@ -192,10 +142,7 @@ msgid "Do keep in mind that wrapping it in quotes leaves it as-is:"
msgstr "引用符で囲んだ場合、消えずに残るので注意してください:"
msgstr "引用符で囲んだ場合、消えずに残るので注意してください:"
#: ../../ext/commands/commands.rst:160
#: ../../ext/commands/commands.rst:160
msgid ""
msgid "By default, the keyword-only arguments are stripped of white space to make it easier to work with. This behaviour can be toggled by the :attr:`.Command.rest_is_raw` argument in the decorator."
"By default, the keyword-only arguments are stripped of white space to "
"make it easier to work with. This behaviour can be toggled by the "
":attr:`.Command.rest_is_raw` argument in the decorator."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:166
#: ../../ext/commands/commands.rst:166
@ -203,16 +150,11 @@ msgid "Invocation Context"
msgstr "呼び出しコンテクスト"
msgstr "呼び出しコンテクスト"
#: ../../ext/commands/commands.rst:168
#: ../../ext/commands/commands.rst:168
msgid ""
msgid "As seen earlier, every command must take at least a single parameter, called the :class:`~ext.commands.Context`."
"As seen earlier, every command must take at least a single parameter, "
msgid "This parameter gives you access to something called the \"invocation context\". Essentially all the information you need to know how the command was executed. It contains a lot of useful information:"
"This parameter gives you access to something called the \"invocation "
"context\". Essentially all the information you need to know how the "
"command was executed. It contains a lot of useful information:"
msgid "The context implements the :class:`abc.Messageable` interface, so anything you can do on a :class:`abc.Messageable` you can do on the :class:`~ext.commands.Context`."
"The context implements the :class:`abc.Messageable` interface, so "
msgid "Adding bot arguments with function parameters is only the first step in defining your bot's command interface. To actually make use of the arguments, we usually want to convert the data into a target type. We call these :ref:`ext_commands_api_converters`."
"Adding bot arguments with function parameters is only the first step in "
msgid "We specify converters by using something called a **function annotation**. This is a Python 3 exclusive feature that was introduced in :pep:`3107`."
"We specify converters by using something called a **function "
msgid "Unlike the other basic converters, the :class:`bool` converter is treated slightly different. Instead of casting directly to the :class:`bool` type, which would result in any non-empty argument returning ``True``, it instead evaluates the argument as ``True`` or ``False`` based on it's given content:"
"Unlike the other basic converters, the :class:`bool` converter is treated"
msgid "Sometimes a basic converter doesn't have enough information that we need. For example, sometimes we want to get some information from the :class:`Message` that called the command or we want to do some asynchronous processing."
"Sometimes a basic converter doesn't have enough information that we need."
msgid "For this, the library provides the :class:`~ext.commands.Converter` interface. This allows you to have access to the :class:`.Context` and have the callable be asynchronous. Defining a custom converter using this interface requires overriding a single method, :meth:`.Converter.convert`."
"For this, the library provides the :class:`~ext.commands.Converter` "
msgid "Having the possibility of the converter be constructed allows you to set up some state in the converter's ``__init__`` for fine tuning the converter. An example of this is actually in the library, :class:`~ext.commands.clean_content`."
"Having the possibility of the converter be constructed allows you to set "
msgid "If we don't want to inherit from :class:`~ext.commands.Converter`, we can still provide a converter that has the advanced functionalities of an advanced converter and save us from specifying two types."
"If we don't want to inherit from :class:`~ext.commands.Converter`, we can"
" still provide a converter that has the advanced functionalities of an "
"advanced converter and save us from specifying two types."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:302
#: ../../ext/commands/commands.rst:302
msgid ""
msgid "For example, a common idiom would be to have a class and a converter for that class:"
"For example, a common idiom would be to have a class and a converter for "
"that class:"
msgstr "例えば、一般的な書き方だと、クラスとそのクラスへのコンバーターを定義します:"
msgstr "例えば、一般的な書き方だと、クラスとそのクラスへのコンバーターを定義します:"
#: ../../ext/commands/commands.rst:328
#: ../../ext/commands/commands.rst:328
msgid ""
msgid "This can get tedious, so an inline advanced converter is possible through a ``classmethod`` inside the type:"
"This can get tedious, so an inline advanced converter is possible through"
msgid "When this command is executed, it attempts to convert the string given into a :class:`Member` and then passes it as a parameter for the function. This works by checking if the string is a mention, an ID, a nickname, a username + discriminator, or just a regular username. The default set of converters have been written to be as easy to use as possible."
"When this command is executed, it attempts to convert the string given "
msgid "By providing the converter it allows us to use them as building blocks for another converter:"
"By providing the converter it allows us to use them as building blocks "
"for another converter:"
msgstr "コンバーターを継承することで、他のコンバーターの一部として使うことができます:"
msgstr "コンバーターを継承することで、他のコンバーターの一部として使うことができます:"
#: ../../ext/commands/commands.rst:438
#: ../../ext/commands/commands.rst:438
@ -577,11 +419,7 @@ msgid "Special Converters"
msgstr "特殊なコンバーター"
msgstr "特殊なコンバーター"
#: ../../ext/commands/commands.rst:440
#: ../../ext/commands/commands.rst:440
msgid ""
msgid "The command extension also has support for certain converters to allow for more advanced and intricate use cases that go beyond the generic linear parsing. These converters allow you to introduce some more relaxed and dynamic grammar to your commands in an easy to use manner."
"The command extension also has support for certain converters to allow "
"for more advanced and intricate use cases that go beyond the generic "
"linear parsing. These converters allow you to introduce some more relaxed"
" and dynamic grammar to your commands in an easy to use manner."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:445
#: ../../ext/commands/commands.rst:445
@ -589,32 +427,15 @@ msgid "typing.Union"
msgstr "typing.Union"
msgstr "typing.Union"
#: ../../ext/commands/commands.rst:447
#: ../../ext/commands/commands.rst:447
msgid ""
msgid "A :data:`typing.Union` is a special type hint that allows for the command to take in any of the specific types instead of a singular type. For example, given the following:"
"A :data:`typing.Union` is a special type hint that allows for the command"
" to take in any of the specific types instead of a singular type. For "
msgid "The ``what`` parameter would either take a :class:`discord.TextChannel` converter or a :class:`discord.Member` converter. The way this works is through a left-to-right order. It first attempts to convert the input to a :class:`discord.TextChannel`, and if it fails it tries to convert it to a :class:`discord.Member`. If all converters fail, then a special error is raised, :exc:`~ext.commands.BadUnionArgument`."
"The ``what`` parameter would either take a :class:`discord.TextChannel` "
msgid "A :data:`typing.Optional` is a special type hint that allows for \"back-referencing\" behaviour. If the converter fails to parse into the specified type, the parser will skip the parameter and then either ``None`` or the specified default will be passed into the parameter instead. The parser will then continue on to the next parameters and converters, if any."
"A :data:`typing.Optional` is a special type hint that allows for \"back-"
msgid "In this example, since the argument could not be converted into an ``int``, the default of ``99`` is passed and the parser resumes handling, which in this case would be to pass it into the ``liquid`` parameter."
"In this example, since the argument could not be converted into an "
msgid "The :data:`~ext.commands.Greedy` converter is a generalisation of the :data:`typing.Optional` converter, except applied to a list of arguments. In simple terms, this means that it tries to convert as much as it can until it can't convert any further."
"The :data:`~ext.commands.Greedy` converter is a generalisation of the "
":data:`typing.Optional` converter, except applied to a list of arguments."
" In simple terms, this means that it tries to convert as much as it can "
"until it can't convert any further."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:509
#: ../../ext/commands/commands.rst:509
@ -670,15 +471,11 @@ msgid "When invoked, it allows for any number of members to be passed in:"
msgstr "これが呼び出されると、任意の数のメンバーを渡すことができます:"
msgstr "これが呼び出されると、任意の数のメンバーを渡すことができます:"
#: ../../ext/commands/commands.rst:513
#: ../../ext/commands/commands.rst:513
msgid ""
msgid "The type passed when using this converter depends on the parameter type that it is being attached to:"
"The type passed when using this converter depends on the parameter type "
"that it is being attached to:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:515
#: ../../ext/commands/commands.rst:515
msgid ""
msgid "Positional parameter types will receive either the default parameter or a :class:`list` of the converted values."
"Positional parameter types will receive either the default parameter or a"
" :class:`list` of the converted values."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:516
#: ../../ext/commands/commands.rst:516
@ -686,21 +483,15 @@ msgid "Variable parameter types will be a :class:`tuple` as usual."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:517
#: ../../ext/commands/commands.rst:517
msgid ""
msgid "Keyword-only parameter types will be the same as if :data:`~ext.commands.Greedy` was not passed at all."
"Keyword-only parameter types will be the same as if "
":data:`~ext.commands.Greedy` was not passed at all."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:519
#: ../../ext/commands/commands.rst:519
msgid ""
msgid ":data:`~ext.commands.Greedy` parameters can also be made optional by specifying an optional value."
":data:`~ext.commands.Greedy` parameters can also be made optional by "
"specifying an optional value."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:521
#: ../../ext/commands/commands.rst:521
msgid ""
msgid "When mixed with the :data:`typing.Optional` converter you can provide simple and expressive command invocation syntaxes:"
"When mixed with the :data:`typing.Optional` converter you can provide "
"simple and expressive command invocation syntaxes:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:536
#: ../../ext/commands/commands.rst:536
@ -708,29 +499,15 @@ msgid "This command can be invoked any of the following ways:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:546
#: ../../ext/commands/commands.rst:546
msgid ""
msgid "The usage of :data:`~ext.commands.Greedy` and :data:`typing.Optional` are powerful and useful, however as a price, they open you up to some parsing ambiguities that might surprise some people."
"The usage of :data:`~ext.commands.Greedy` and :data:`typing.Optional` are"
" powerful and useful, however as a price, they open you up to some "
"parsing ambiguities that might surprise some people."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:549
#: ../../ext/commands/commands.rst:549
msgid ""
msgid "For example, a signature expecting a :data:`typing.Optional` of a :class:`discord.Member` followed by a :class:`int` could catch a member named after a number due to the different ways a :class:`~ext.commands.MemberConverter` decides to fetch members. You should take care to not introduce unintended parsing ambiguities in your code. One technique would be to clamp down the expected syntaxes allowed through custom converters or reordering the parameters to minimise clashes."
"For example, a signature expecting a :data:`typing.Optional` of a "
":class:`discord.Member` followed by a :class:`int` could catch a member "
"named after a number due to the different ways a "
":class:`~ext.commands.MemberConverter` decides to fetch members. You "
"should take care to not introduce unintended parsing ambiguities in your "
"code. One technique would be to clamp down the expected syntaxes allowed "
"through custom converters or reordering the parameters to minimise "
"clashes."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:555
#: ../../ext/commands/commands.rst:555
msgid ""
msgid "To help aid with some parsing ambiguities, :class:`str`, ``None`` and :data:`~ext.commands.Greedy` are forbidden as parameters for the :data:`~ext.commands.Greedy` converter."
"To help aid with some parsing ambiguities, :class:`str`, ``None`` and "
":data:`~ext.commands.Greedy` are forbidden as parameters for the "
":data:`~ext.commands.Greedy` converter."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:561
#: ../../ext/commands/commands.rst:561
@ -738,34 +515,19 @@ msgid "Error Handling"
msgstr "エラーハンドリング"
msgstr "エラーハンドリング"
#: ../../ext/commands/commands.rst:563
#: ../../ext/commands/commands.rst:563
msgid ""
msgid "When our commands fail to either parse we will, by default, receive a noisy error in ``stderr`` of our console that tells us that an error has happened and has been silently ignored."
"When our commands fail to either parse we will, by default, receive a "
"noisy error in ``stderr`` of our console that tells us that an error has "
"happened and has been silently ignored."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:566
#: ../../ext/commands/commands.rst:566
msgid ""
msgid "In order to handle our errors, we must use something called an error handler. There is a global error handler, called :func:`on_command_error` which works like any other event in the :ref:`discord-api-events`. This global error handler is called for every error reached."
"In order to handle our errors, we must use something called an error "
"handler. There is a global error handler, called :func:`on_command_error`"
" which works like any other event in the :ref:`discord-api-events`. This "
"global error handler is called for every error reached."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:570
#: ../../ext/commands/commands.rst:570
msgid ""
msgid "Most of the time however, we want to handle an error local to the command itself. Luckily, commands come with local error handlers that allow us to do just that. First we decorate an error handler function with :meth:`.Command.error`:"
"Most of the time however, we want to handle an error local to the command"
" itself. Luckily, commands come with local error handlers that allow us "
"to do just that. First we decorate an error handler function with "
":meth:`.Command.error`:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:586
#: ../../ext/commands/commands.rst:586
msgid ""
msgid "The first parameter of the error handler is the :class:`.Context` while the second one is an exception that is derived from :exc:`~ext.commands.CommandError`. A list of errors is found in the :ref:`ext_commands_api_errors` page of the documentation."
"The first parameter of the error handler is the :class:`.Context` while "
"the second one is an exception that is derived from "
":exc:`~ext.commands.CommandError`. A list of errors is found in the "
":ref:`ext_commands_api_errors` page of the documentation."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:590
#: ../../ext/commands/commands.rst:590
@ -773,19 +535,11 @@ msgid "Checks"
msgstr "チェック"
msgstr "チェック"
#: ../../ext/commands/commands.rst:592
#: ../../ext/commands/commands.rst:592
msgid ""
msgid "There are cases when we don't want a user to use our commands. They don't have permissions to do so or maybe we blocked them from using our bot earlier. The commands extension comes with full support for these things in a concept called a :ref:`ext_commands_api_checks`."
"There are cases when we don't want a user to use our commands. They don't"
msgid "To register a check for a command, we would have two ways of doing so. The first is using the :meth:`~ext.commands.check` decorator. For example:"
"To register a check for a command, we would have two ways of doing so. "
"The first is using the :meth:`~ext.commands.check` decorator. For "
"example:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:620
#: ../../ext/commands/commands.rst:620
msgid ""
msgid "This would only evaluate the command if the function ``is_owner`` returns ``True``. Sometimes we re-use a check often and want to split it into its own decorator. To do that we can just add another level of depth:"
"This would only evaluate the command if the function ``is_owner`` returns"
" ``True``. Sometimes we re-use a check often and want to split it into "
"its own decorator. To do that we can just add another level of depth:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:637
#: ../../ext/commands/commands.rst:637
msgid ""
msgid "Since an owner check is so common, the library provides it for you (:func:`~ext.commands.is_owner`):"
"Since an owner check is so common, the library provides it for you "
"(:func:`~ext.commands.is_owner`):"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:647
#: ../../ext/commands/commands.rst:647
@ -833,29 +575,19 @@ msgid "When multiple checks are specified, **all** of them must be ``True``:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:663
#: ../../ext/commands/commands.rst:663
msgid ""
msgid "If any of those checks fail in the example above, then the command will not be run."
"If any of those checks fail in the example above, then the command will "
"not be run."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:665
#: ../../ext/commands/commands.rst:665
msgid ""
msgid "When an error happens, the error is propagated to the :ref:`error handlers <ext_commands_error_handler>`. If you do not raise a custom :exc:`~ext.commands.CommandError` derived exception, then it will get wrapped up into a :exc:`~ext.commands.CheckFailure` exception as so:"
"When an error happens, the error is propagated to the :ref:`error "
"handlers <ext_commands_error_handler>`. If you do not raise a custom "
":exc:`~ext.commands.CommandError` derived exception, then it will get "
"wrapped up into a :exc:`~ext.commands.CheckFailure` exception as so:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:683
#: ../../ext/commands/commands.rst:683
msgid ""
msgid "If you want a more robust error system, you can derive from the exception and raise it instead of returning ``False``:"
"If you want a more robust error system, you can derive from the exception"
" and raise it instead of returning ``False``:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:708
#: ../../ext/commands/commands.rst:708
msgid ""
msgid "Since having a ``guild_only`` decorator is pretty common, it comes built-in via :func:`~ext.commands.guild_only`."
"Since having a ``guild_only`` decorator is pretty common, it comes built-"
"in via :func:`~ext.commands.guild_only`."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:711
#: ../../ext/commands/commands.rst:711
@ -863,16 +595,11 @@ msgid "Global Checks"
msgstr "グローバルチェック"
msgstr "グローバルチェック"
#: ../../ext/commands/commands.rst:713
#: ../../ext/commands/commands.rst:713
msgid ""
msgid "Sometimes we want to apply a check to **every** command, not just certain commands. The library supports this as well using the global check concept."
"Sometimes we want to apply a check to **every** command, not just certain"
" commands. The library supports this as well using the global check "
"concept."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:716
#: ../../ext/commands/commands.rst:716
msgid ""
msgid "Global checks work similarly to regular checks except they are registered with the :func:`.Bot.check` decorator."
"Global checks work similarly to regular checks except they are registered"
" with the :func:`.Bot.check` decorator."
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:718
#: ../../ext/commands/commands.rst:718
@ -880,8 +607,6 @@ msgid "For example, to block all DMs we could do the following:"
msgstr ""
msgstr ""
#: ../../ext/commands/commands.rst:728
#: ../../ext/commands/commands.rst:728
msgid ""
msgid "Be careful on how you write your global checks, as it could also lock you out of your own bot."
"Be careful on how you write your global checks, as it could also lock you"
msgid "``discord.py`` offers a lower level aspect on interacting with Discord. Often times, the library is used for the creation of bots. However this task can be daunting and confusing to get correctly the first time. Many times there comes a repetition in creating a bot command framework that is extensible, flexible, and powerful. For this reason, ``discord.py`` comes with an extension library that handles this for you."
msgid "``discord.py`` offers a lower level aspect on interacting with Discord. Often times, the library is used for the creation of bots. However this task can be daunting and confusing to get correctly the first time. Many times there comes a repetition in creating a bot command framework that is extensible, flexible, and powerful. For this reason, ``discord.py`` comes with an extension library that handles this for you."
msgid "This is a list of Frequently Asked Questions regarding using ``discord.py`` and its extension modules. Feel free to suggest a new question or submit one via pull requests."
"This is a list of Frequently Asked Questions regarding using "
"``discord.py`` and its extension modules. Feel free to suggest a new "
msgid "A |coroutine_link|_ is a function that must be invoked with ``await`` or ``yield from``. When Python encounters an ``await`` it stops the function's execution at that point and works on other things until it comes back to that point and finishes off its work. This allows for your program to be doing multiple things at the same time without using threads or complicated multiprocessing."
msgid ""
"A |coroutine_link|_ is a function that must be invoked with ``await`` or "
"``yield from``. When Python encounters an ``await`` it stops the "
"function's execution at that point and works on other things until it "
"comes back to that point and finishes off its work. This allows for your "
"program to be doing multiple things at the same time without using "
@ -66,9 +54,7 @@ msgid "Where can I use ``await``\\?"
msgstr "``await`` はどこで使用することができますか。"
msgstr "``await`` はどこで使用することができますか。"
#: ../../faq.rst:31
#: ../../faq.rst:31
msgid ""
msgid "You can only use ``await`` inside ``async def`` functions and nowhere else."
"You can only use ``await`` inside ``async def`` functions and nowhere "
"else."
msgstr "``await`` は ``async def`` 関数の中でのみ使用できます。"
msgstr "``await`` は ``async def`` 関数の中でのみ使用できます。"
#: ../../faq.rst:34
#: ../../faq.rst:34
@ -76,51 +62,20 @@ msgid "What does \"blocking\" mean?"
msgstr "「ブロッキング」とはなんですか。"
msgstr "「ブロッキング」とはなんですか。"
#: ../../faq.rst:36
#: ../../faq.rst:36
msgid ""
msgid "In asynchronous programming a blocking call is essentially all the parts of the function that are not ``await``. Do not despair however, because not all forms of blocking are bad! Using blocking calls is inevitable, but you must work to make sure that you don't excessively block functions. Remember, if you block for too long then your bot will freeze since it has not stopped the function's execution at that point to do other things."
"In asynchronous programming a blocking call is essentially all the parts "
msgid "If logging is enabled, this library will attempt to warn you that blocking is occurring with the message: ``Heartbeat blocked for more than N seconds.`` See :ref:`logging_setup` for details on enabling logging."
"If logging is enabled, this library will attempt to warn you that "
msgstr "もしロギングを有効にしている場合、ライブラリはブロッキングが起きていることを次のメッセージで警告しようと試みます: ``Heartbeat blocked for more than N seconds.`` ロギングを有効にするには、:ref:`logging_setup`をご覧ください。"
"blocking is occurring with the message: ``Heartbeat blocked for more than"
" N seconds.`` See :ref:`logging_setup` for details on enabling logging."
msgid "A common source of blocking for too long is something like :func:`time.sleep`. Don't do that. Use :func:`asyncio.sleep` instead. Similar to this example: ::"
"A common source of blocking for too long is something like "
msgid "Another common source of blocking for too long is using HTTP requests with the famous module :doc:`req:index`. While :doc:`req:index` is an amazing module for non-asynchronous programming, it is not a good choice for :mod:`asyncio` because certain requests can block the event loop too long. Instead, use the :doc:`aiohttp <aio:index>` library which is installed on the side with this library."
msgid ""
"Another common source of blocking for too long is using HTTP requests "
"with the famous module :doc:`req:index`. While :doc:`req:index` is an "
"amazing module for non-asynchronous programming, it is not a good choice "
"for :mod:`asyncio` because certain requests can block the event loop too "
"long. Instead, use the :doc:`aiohttp <aio:index>` library which is "
@ -139,22 +94,12 @@ msgid "How do I set the \"Playing\" status?"
msgstr "「プレイ中」状態の設定をするにはどうすればいいですか。"
msgstr "「プレイ中」状態の設定をするにはどうすればいいですか。"
#: ../../faq.rst:82
#: ../../faq.rst:82
msgid ""
msgid "There is a method for this under :class:`Client` called :meth:`Client.change_presence`. The relevant aspect of this is its ``activity`` keyword argument which takes in an :class:`Activity` object."
"There is a method for this under :class:`Client` called "
msgid "The status type (playing, listening, streaming, watching) can be set using the :class:`ActivityType` enum. For memory optimisation purposes, some activities are offered in slimmed down versions:"
"The status type (playing, listening, streaming, watching) can be set "
msgid "If you want to upload something from a URL, you will have to use an HTTP request using :doc:`aiohttp <aio:index>` and then pass an :class:`io.BytesIO` instance to :class:`File` like so:"
msgid ""
"If you want to upload something from a URL, you will have to use an HTTP "
"request using :doc:`aiohttp <aio:index>` and then pass an "
":class:`io.BytesIO` instance to :class:`File` like so:"
@ -225,10 +158,7 @@ msgid "You use the :meth:`Message.add_reaction` method."
msgstr ":meth:`Client.add_reaction` を使用してください。"
msgstr ":meth:`Client.add_reaction` を使用してください。"
#: ../../faq.rst:153
#: ../../faq.rst:153
msgid ""
msgid "If you want to use unicode emoji, you must pass a valid unicode code point in a string. In your code, you can write this in a few different ways:"
"If you want to use unicode emoji, you must pass a valid unicode code "
"point in a string. In your code, you can write this in a few different "
msgid "In case you want to use emoji that come from a message, you already get their code points in the content without needing to do anything special. You **cannot** send ``':thumbsup:'`` style shorthands."
"In case you want to use emoji that come from a message, you already get "
msgid "For custom emoji, you should pass an instance of :class:`Emoji`. You can also pass a ``'<:name:id>'`` string, but if you can use said emoji, you should be able to use :meth:`Client.get_emoji` to get an emoji via ID or use :func:`utils.find`/ :func:`utils.get` on :attr:`Client.emojis` or :attr:`Guild.emojis` collections."
"For custom emoji, you should pass an instance of :class:`Emoji`. You can "
msgid "The name and ID of a custom emoji can be found with the client by prefixing ``:custom_emoji:`` with a backslash. For example, sending the message ``\\:python3:`` with the client will result in ``<:python3:232720527448342530>``."
"The name and ID of a custom emoji can be found with the client by "
"prefixing ``:custom_emoji:`` with a backslash. For example, sending the "
"message ``\\:python3:`` with the client will result in "
@ -282,45 +195,23 @@ msgid "How do I pass a coroutine to the player's \"after\" function?"
msgstr "どうやってコルーチンをプレイヤーの後処理に渡すのですか。"
msgstr "どうやってコルーチンをプレイヤーの後処理に渡すのですか。"
#: ../../faq.rst:194
#: ../../faq.rst:194
msgid ""
msgid "The library's music player launches on a separate thread, ergo it does not execute inside a coroutine. This does not mean that it is not possible to call a coroutine in the ``after`` parameter. To do so you must pass a callable that wraps up a couple of aspects."
"The library's music player launches on a separate thread, ergo it does "
msgid "The first gotcha that you must be aware of is that calling a coroutine is not a thread-safe operation. Since we are technically in another thread, we must take caution in calling thread-safe operations so things do not bug out. Luckily for us, :mod:`asyncio` comes with a :func:`asyncio.run_coroutine_threadsafe` function that allows us to call a coroutine from another thread."
"The first gotcha that you must be aware of is that calling a coroutine is"
msgid "However, this function returns a :class:`concurrent.Future` and to actually call it we have to fetch its result. Putting all of this together we can do the following: ::"
"However, this function returns a :class:`concurrent.Future` and to "
@ -405,16 +291,11 @@ msgid "How do I make a web request?"
msgstr ""
msgstr ""
#: ../../faq.rst:263
#: ../../faq.rst:263
msgid ""
msgid "To make a request, you should use a non-blocking library. This library already uses and requires a 3rd party library for making requests, ``aiohttp``."
"To make a request, you should use a non-blocking library. This library "
"already uses and requires a 3rd party library for making requests, "
"``aiohttp``."
msgstr ""
msgstr ""
#: ../../faq.rst:273
#: ../../faq.rst:273
msgid ""
msgid "See `aiohttp's full documentation <http://aiohttp.readthedocs.io/en/stable/>`_ for more information."
"See `aiohttp's full documentation "
"<http://aiohttp.readthedocs.io/en/stable/>`_ for more information."
msgstr ""
msgstr ""
#: ../../faq.rst:276
#: ../../faq.rst:276
@ -422,17 +303,11 @@ msgid "How do I use a local image file for an embed image?"
msgstr ""
msgstr ""
#: ../../faq.rst:278
#: ../../faq.rst:278
msgid ""
msgid "Discord special-cases uploading an image attachment and using it within an embed so that it will not display separately, but instead in the embed's thumbnail, image, footer or author icon."
"Discord special-cases uploading an image attachment and using it within "
"an embed so that it will not display separately, but instead in the "
"embed's thumbnail, image, footer or author icon."
msgstr ""
msgstr ""
#: ../../faq.rst:281
#: ../../faq.rst:281
msgid ""
msgid "To do so, upload the image normally with :meth:`abc.Messageable.send`, and set the embed's image URL to ``attachment://image.png``, where ``image.png`` is the filename of the image you will send."
"To do so, upload the image normally with :meth:`abc.Messageable.send`, "
"and set the embed's image URL to ``attachment://image.png``, where "
"``image.png`` is the filename of the image you will send."
msgstr ""
msgstr ""
#: ../../faq.rst:295
#: ../../faq.rst:295
@ -444,10 +319,7 @@ msgid "Is there an event for invites or audit log entries being created?"
msgstr ""
msgstr ""
#: ../../faq.rst:300
#: ../../faq.rst:300
msgid ""
msgid "Since Discord does not dispatch this information in the gateway, the library cannot provide this information. This is currently a Discord limitation."
"Since Discord does not dispatch this information in the gateway, the "
"library cannot provide this information. This is currently a Discord "
"limitation."
msgstr ""
msgstr ""
#: ../../faq.rst:304
#: ../../faq.rst:304
@ -463,13 +335,8 @@ msgid "Why does ``on_message`` make my commands stop working?"
msgid "Overriding the default provided ``on_message`` forbids any extra commands from running. To fix this, add a ``bot.process_commands(message)`` line at the end of your ``on_message``. For example: ::"
"Overriding the default provided ``on_message`` forbids any extra commands"
@ -480,15 +347,8 @@ msgid "In a simple command defined as: ::"
msgstr "次の簡単なコマンドを見てみましょう。"
msgstr "次の簡単なコマンドを見てみましょう。"
#: ../../faq.rst:329
#: ../../faq.rst:329
msgid ""
msgid "Calling it via ``?echo a b c`` will only fetch the first argument and disregard the rest. To fix this you should either call it via ``?echo \"a b c\"`` or change the signature to have \"consume rest\" behaviour. Example: ::"
"Calling it via ``?echo a b c`` will only fetch the first argument and "
msgstr "このコマンドを ``?echo a b c`` のように実行したとき、コマンドに渡されるのは最初の引数だけです。その後の引数はすべて無視されます。これを正常に動かすためには ``?echo \"a b c\"`` のようにしてコマンドを実行するか、コマンドの引数を下記の例のようにしてみましょう"
"disregard the rest. To fix this you should either call it via ``?echo \"a"
" b c\"`` or change the signature to have \"consume rest\" behaviour. "
@ -515,13 +371,8 @@ msgid "How do I make a subcommand?"
msgstr "サブコマンドを作るにはどうすればいいですか。"
msgstr "サブコマンドを作るにはどうすればいいですか。"
#: ../../faq.rst:353
#: ../../faq.rst:353
msgid ""
msgid "Use the ``group`` decorator. This will transform the callback into a ``Group`` which will allow you to add commands into the group operating as \"subcommands\". These groups can be arbitrarily nested as well."
"Use the ``group`` decorator. This will transform the callback into a "
msgid "discord.py works with Python 3.5.3 or higher. Support for earlier versions of Python is not provided. Python 2.7 or lower is not supported. Python 3.4 or lower is not supported due to one of the dependencies (:doc:`aiohttp <aio:index>`) not supporting Python 3.4."
msgid ""
"discord.py works with Python 3.5.3 or higher. Support for earlier "
"versions of Python is not provided. Python 2.7 or lower is not supported."
" Python 3.4 or lower is not supported due to one of the dependencies "
"(:doc:`aiohttp <aio:index>`) not supporting Python 3.4."
msgid "Sometimes you want to keep libraries from polluting system installs or use a different version of libraries than the ones installed on the system. You might also not have permissions to install libaries system-wide. For this purpose, the standard library as of Python 3.3 comes with a concept called \"Virtual Environment\"s to help maintain these separate versions."
"Sometimes you want to keep libraries from polluting system installs or "
"use a different version of libraries than the ones installed on the "
"system. You might also not have permissions to install libaries system-"
"wide. For this purpose, the standard library as of Python 3.3 comes with "
"a concept called \"Virtual Environment\"s to help maintain these separate"
msgid "discord.py revolves around the concept of :ref:`events <discord-api-events>`. An event is something you listen to and then respond to. For example, when a message happens, you will receive an event about it that you can respond to."
"discord.py revolves around the concept of :ref:`events <discord-api-"
msgid "The biggest major change is that the library has dropped support to all versions prior to Python 3.4.2. This was made to support :mod:`asyncio`, in which more detail can be seen :issue:`in the corresponding issue <50>`. To reiterate this, the implication is that **python version 2.7 and 3.3 are no longer supported**."
msgid ""
"The biggest major change is that the library has dropped support to all "
"versions prior to Python 3.4.2. This was made to support :mod:`asyncio`, "
"in which more detail can be seen :issue:`in the corresponding issue "
"<50>`. To reiterate this, the implication is that **python version 2.7 "
msgid "Below are all the other major changes from v0.9.0 to v0.10.0."
msgid "Below are all the other major changes from v0.9.0 to v0.10.0."
@ -46,13 +38,8 @@ msgid "Event Registration"
msgstr "イベント登録"
msgstr "イベント登録"
#: ../../migrating_to_async.rst:23
#: ../../migrating_to_async.rst:23
msgid ""
msgid "All events before were registered using :meth:`Client.event`. While this is still possible, the events must be decorated with ``@asyncio.coroutine``."
"All events before were registered using :meth:`Client.event`. While this "
msgid "Be aware however, that this is still a coroutine and your other functions that are coroutines must be decorated with ``@asyncio.coroutine`` or be ``async def``."
"Be aware however, that this is still a coroutine and your other functions"
msgid "Some events in v0.9.0 were considered pretty useless due to having no separate states. The main events that were changed were the ``_update`` events since previously they had no context on what was changed."
"Some events in v0.9.0 were considered pretty useless due to having no "
msgid "Note that ``on_status`` was removed. If you want its functionality, use :func:`on_member_update`. See :ref:`discord-api-events` for more information. Other removed events include ``on_socket_closed``, ``on_socket_receive``, and ``on_socket_opened``."
"Note that ``on_status`` was removed. If you want its functionality, use "
msgid "The biggest change that the library went through is that almost every function in :class:`Client` was changed to be a `coroutine <py:library/asyncio-task.html>`_. Functions that are marked as a coroutine in the documentation must be awaited from or yielded from in order for the computation to be done. For example..."
msgid ""
"The biggest change that the library went through is that almost every "
"function in :class:`Client` was changed to be a `coroutine <py:library"
"/asyncio-task.html>`_. Functions that are marked as a coroutine in the "
"documentation must be awaited from or yielded from in order for the "
msgid "For performance reasons, many of the internal data structures were changed into a dictionary to support faster lookup. As a consequence, this meant that some lists that were exposed via the API have changed into iterables and not sequences. In short, this means that certain attributes now only support iteration and not any of the sequence functions."
"For performance reasons, many of the internal data structures were "
"changed into a dictionary to support faster lookup. As a consequence, "
"this meant that some lists that were exposed via the API have changed "
"into iterables and not sequences. In short, this means that certain "
"attributes now only support iteration and not any of the sequence "
@ -176,18 +121,11 @@ msgid "Some examples of previously valid behaviour that is now invalid"
msgstr "以前は有効であったが、現在は無効である操作の例。"
msgstr "以前は有効であったが、現在は無効である操作の例。"
#: ../../migrating_to_async.rst:145
#: ../../migrating_to_async.rst:145
msgid ""
msgid "Since they are no longer :obj:`list`\\s, they no longer support indexing or any operation other than iterating. In order to get the old behaviour you should explicitly cast it to a list."
"Since they are no longer :obj:`list`\\s, they no longer support indexing "
msgid "The main reason for this change was to reduce the use of finicky strings in the API as this could give users a false sense of power. More information can be found in the :ref:`discord-api-enums` page."
"The main reason for this change was to reduce the use of finicky strings "
msgid "All the :class:`Permissions` related attributes have been renamed and the `can_` prefix has been dropped. So for example, ``can_manage_messages`` has become ``manage_messages``."
"All the :class:`Permissions` related attributes have been renamed and the"
msgid "Since 3.0+ of Python, we can now force questions to take in forced keyword arguments. A keyword argument is when you explicitly specify the name of the variable and assign to it, for example: ``foo(name='test')``. Due to this support, some functions in the library were changed to force things to take said keyword arguments. This is to reduce errors of knowing the argument order and the issues that could arise from them."
"Since 3.0+ of Python, we can now force questions to take in forced "
msgid "In earlier versions of discord.py, ``client.run()`` was a blocking call to the main thread that called it. In v0.10.0 it is still a blocking call but it handles the event loop for you. However, in order to do that you must pass in your credentials to :meth:`Client.run`."
"In earlier versions of discord.py, ``client.run()`` was a blocking call "
msgid "Like in the older ``Client.run`` function, the newer one must be the one of the last functions to call. This is because the function is **blocking**. Registering events or doing anything after :meth:`Client.run` will not execute until the function returns."
"Like in the older ``Client.run`` function, the newer one must be the one "
msgid "This is a utility function that abstracts the event loop for you. There's no need for the run call to be blocking and out of your control. Indeed, if you want control of the event loop then doing so is quite straightforward:"
"This is a utility function that abstracts the event loop for you. There's"