committed by
Rapptz
4 changed files with 2543 additions and 2414 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -2,23 +2,26 @@ |
|||||
# Copyright (C) 2015-2017, Rapptz |
# Copyright (C) 2015-2017, Rapptz |
||||
# This file is distributed under the same license as the discord.py package. |
# This file is distributed under the same license as the discord.py package. |
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018. |
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018. |
||||
# |
# |
||||
|
# Translators: |
||||
|
# 竹内 歩夢 <[email protected]>, 2018 |
||||
|
# Episword <[email protected]>, 2018 |
||||
|
# |
||||
#, fuzzy |
#, fuzzy |
||||
msgid "" |
msgid "" |
||||
msgstr "" |
msgstr "" |
||||
"Project-Id-Version: discord.py 1.0.0a\n" |
"Project-Id-Version: discord.py 1.0.0a\n" |
||||
"Report-Msgid-Bugs-To: \n" |
"Report-Msgid-Bugs-To: \n" |
||||
"POT-Creation-Date: 2018-09-24 23:41-0400\n" |
"POT-Creation-Date: 2018-09-24 23:41-0400\n" |
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
"PO-Revision-Date: 2018-08-01 17:09+0000\n" |
||||
"Last-Translator: 竹内 歩夢 <[email protected]>, 2018\n" |
"Last-Translator: Episword <[email protected]>, 2018\n" |
||||
"Language: ja_JP\n" |
"Language-Team: Japanese (Japan) (https://www.transifex.com/discord-py/teams/88924/ja_JP/)\n" |
||||
"Language-Team: Japanese (Japan) (https://www.transifex.com/discord-" |
|
||||
"py/teams/88924/ja_JP/)\n" |
|
||||
"Plural-Forms: nplurals=1; plural=0\n" |
|
||||
"MIME-Version: 1.0\n" |
"MIME-Version: 1.0\n" |
||||
"Content-Type: text/plain; charset=utf-8\n" |
"Content-Type: text/plain; charset=UTF-8\n" |
||||
"Content-Transfer-Encoding: 8bit\n" |
"Content-Transfer-Encoding: 8bit\n" |
||||
"Generated-By: Babel 2.5.3\n" |
"Generated-By: Babel 2.5.3\n" |
||||
|
"Language: ja_JP\n" |
||||
|
"Plural-Forms: nplurals=1; plural=0;\n" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:6 |
#: ../../ext/commands/commands.rst:6 |
||||
msgid "Commands" |
msgid "Commands" |
||||
@ -26,16 +29,17 @@ msgstr "Commands" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:8 |
#: ../../ext/commands/commands.rst:8 |
||||
msgid "" |
msgid "" |
||||
"One of the most appealing aspect of the command extension is how easy it " |
"One of the most appealing aspect of the command extension is how easy it is " |
||||
"is to define commands and how you can arbitrarily nest groups and " |
"to define commands and how you can arbitrarily nest groups and commands to " |
||||
"commands to have a rich sub-command system." |
"have a rich sub-command system." |
||||
msgstr "" |
msgstr "" |
||||
|
"コマンド拡張の最も魅力的な機能の一つは、簡単にコマンドが定義でき、かつそのコマンドを好きなようにネスト状にして、豊富なサブコマンドを用意することができる点です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:11 |
#: ../../ext/commands/commands.rst:11 |
||||
msgid "" |
msgid "" |
||||
"Commands are defined by attaching it to a regular Python function. The " |
"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 " |
"command is then invoked by the user using a similar signature to the Python " |
||||
"Python function." |
"function." |
||||
msgstr "コマンドは、Pythonの関数と関連付けすることによって定義され、同様のシグネチャを使用してユーザーに呼び出されます。" |
msgstr "コマンドは、Pythonの関数と関連付けすることによって定義され、同様のシグネチャを使用してユーザーに呼び出されます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:14 |
#: ../../ext/commands/commands.rst:14 |
||||
@ -43,22 +47,26 @@ msgid "For example, in the given command definition:" |
|||||
msgstr "例えば、指定されたコマンド定義を使うと次のようになります:" |
msgstr "例えば、指定されたコマンド定義を使うと次のようになります:" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:22 |
#: ../../ext/commands/commands.rst:22 |
||||
msgid "With the following prefix (``$``), it would be invoked by the user via:" |
msgid "" |
||||
|
"With the following prefix (``$``), it would be invoked by the user via:" |
||||
msgstr "Prefixを (``$``) としたとすると、このコマンドは次の用に実行できます。" |
msgstr "Prefixを (``$``) としたとすると、このコマンドは次の用に実行できます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:28 |
#: ../../ext/commands/commands.rst:28 |
||||
msgid "" |
msgid "" |
||||
"A command must always have at least one parameter, ``ctx``, which is the " |
"A command must always have at least one parameter, ``ctx``, which is the " |
||||
":class:`.Context` as the first one." |
":class:`.Context` as the first one." |
||||
msgstr "" |
msgstr "コマンドには、少なくとも :class:`.Context` を渡すための引数 ``ctx`` が必要です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:30 |
#: ../../ext/commands/commands.rst:30 |
||||
msgid "" |
msgid "" |
||||
"There are two ways of registering a command. The first one is by using " |
"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 " |
":meth:`.Bot.command` decorator, as seen in the example above. The second is " |
||||
"is using the :func:`~ext.commands.command` decorator followed by " |
"using the :func:`~ext.commands.command` decorator followed by " |
||||
":meth:`.Bot.add_command` on the instance." |
":meth:`.Bot.add_command` on the instance." |
||||
msgstr "" |
msgstr "" |
||||
|
"コマンドを登録するには二通りの方法があります。一つ目は :meth:`.Bot.command` を使用する方法で、二つ目が " |
||||
|
":func:`~ext.commands.command` デコレータを使用して :meth:`.Bot.add_command` " |
||||
|
"でインスタンスにコマンドを追加していく方法です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:34 |
#: ../../ext/commands/commands.rst:34 |
||||
msgid "Essentially, these two are equivalent: ::" |
msgid "Essentially, these two are equivalent: ::" |
||||
@ -68,14 +76,16 @@ msgstr "本質的に、これら2つは同等になります: ::" |
|||||
msgid "" |
msgid "" |
||||
"Since the :meth:`.Bot.command` decorator is shorter and easier to " |
"Since the :meth:`.Bot.command` decorator is shorter and easier to " |
||||
"comprehend, it will be the one used throughout the documentation here." |
"comprehend, it will be the one used throughout the documentation here." |
||||
msgstr "" |
msgstr ":meth:`.Bot.command` が簡単かつ理解がしやすいので、ドキュメント上ではこちらを使っています。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:55 |
#: ../../ext/commands/commands.rst:55 |
||||
msgid "" |
msgid "" |
||||
"Any parameter that is accepted by the :class:`.Command` constructor can " |
"Any parameter that is accepted by the :class:`.Command` constructor can be " |
||||
"be passed into the decorator. For example, to change the name to " |
"passed into the decorator. For example, to change the name to something " |
||||
"something other than the function would be as simple as doing this:" |
"other than the function would be as simple as doing this:" |
||||
msgstr "" |
msgstr "" |
||||
|
":class:`.Command` " |
||||
|
"のコンストラクタの引数はデコレータに渡すことで利用できます。例えば、コマンドの名前を関数以外のものへと変更したい場合は以下のように簡単に設定することができます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:65 |
#: ../../ext/commands/commands.rst:65 |
||||
msgid "Parameters" |
msgid "Parameters" |
||||
@ -86,44 +96,45 @@ msgid "" |
|||||
"Since we define commands by making Python functions, we also define the " |
"Since we define commands by making Python functions, we also define the " |
||||
"argument passing behaviour by the function parameters." |
"argument passing behaviour by the function parameters." |
||||
msgstr "" |
msgstr "" |
||||
|
"Pythonの関数定義によって、同時にコマンドを定義するので、関数のパラメーターを設定することにより、コマンドの引数受け渡し動作も定義することができます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:70 |
#: ../../ext/commands/commands.rst:70 |
||||
msgid "" |
msgid "" |
||||
"Certain parameter types do different things in the user side and most " |
"Certain parameter types do different things in the user side and most forms " |
||||
"forms of parameter types are supported." |
"of parameter types are supported." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:73 |
#: ../../ext/commands/commands.rst:73 |
||||
msgid "Positional" |
msgid "Positional" |
||||
msgstr "" |
msgstr "位置引数" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:75 |
#: ../../ext/commands/commands.rst:75 |
||||
msgid "" |
msgid "" |
||||
"The most basic form of parameter passing is the positional parameter. " |
"The most basic form of parameter passing is the positional parameter. This " |
||||
"This is where we pass a parameter as-is:" |
"is where we pass a parameter as-is:" |
||||
msgstr "" |
msgstr "最も基本的な引数は位置パラメーターです。与えられた値をそのまま渡します。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:84 |
#: ../../ext/commands/commands.rst:84 |
||||
msgid "" |
msgid "" |
||||
"On the bot using side, you can provide positional arguments by just " |
"On the bot using side, you can provide positional arguments by just passing " |
||||
"passing a regular string:" |
"a regular string:" |
||||
msgstr "" |
msgstr "Botの使用者側は、通常の文字列を渡すだけで位置引数に値を渡すことができます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:88 |
#: ../../ext/commands/commands.rst:88 |
||||
msgid "To make use of a word with spaces in between, you should quote it:" |
msgid "To make use of a word with spaces in between, you should quote it:" |
||||
msgstr "" |
msgstr "間に空白を含む文字列を渡す場合は、文字列を引用符で囲む必要があります。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:92 |
#: ../../ext/commands/commands.rst:92 |
||||
msgid "" |
msgid "" |
||||
"As a note of warning, if you omit the quotes, you will only get the first" |
"As a note of warning, if you omit the quotes, you will only get the first " |
||||
" word:" |
"word:" |
||||
msgstr "" |
msgstr "引用符を用いなかった場合、最初の文字列のみが渡されます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:96 |
#: ../../ext/commands/commands.rst:96 |
||||
msgid "" |
msgid "" |
||||
"Since positional arguments are just regular Python arguments, you can " |
"Since positional arguments are just regular Python arguments, you can have " |
||||
"have as many as you want:" |
"as many as you want:" |
||||
msgstr "" |
msgstr "位置引数は、Pythonの引数と同じものなので、好きなだけ設定することが可能です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:105 |
#: ../../ext/commands/commands.rst:105 |
||||
msgid "Variable" |
msgid "Variable" |
||||
@ -131,27 +142,29 @@ msgstr "変数" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:107 |
#: ../../ext/commands/commands.rst:107 |
||||
msgid "" |
msgid "" |
||||
"Sometimes you want users to pass in an undetermined number of parameters." |
"Sometimes you want users to pass in an undetermined number of parameters. " |
||||
" The library supports this similar to how variable list parameters are " |
"The library supports this similar to how variable list parameters are done " |
||||
"done in Python:" |
"in Python:" |
||||
msgstr "" |
msgstr "" |
||||
|
"場合によっては、可変長のパラメーターを設定したい場合もあるでしょう。このライブラリはPythonの可変長パラメーターと同様にこれをサポートしています。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:116 |
#: ../../ext/commands/commands.rst:116 |
||||
msgid "" |
msgid "" |
||||
"This allows our user to accept either one or many arguments as they " |
"This allows our user to accept either one or many arguments as they please. " |
||||
"please. This works similar to positional arguments, so multi-word " |
"This works similar to positional arguments, so multi-word parameters should " |
||||
"parameters should be quoted." |
"be quoted." |
||||
msgstr "" |
msgstr "" |
||||
|
"これによって一つ、あるいは複数の引数を受け取ることができます。ただし、引数を渡す際の挙動は位置引数と同様のため、複数の単語を含む文字列は引用符で囲む必要があります。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:119 |
#: ../../ext/commands/commands.rst:119 |
||||
msgid "For example, on the bot side:" |
msgid "For example, on the bot side:" |
||||
msgstr "" |
msgstr "例えば、Bot側ではこのように動きます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:123 |
#: ../../ext/commands/commands.rst:123 |
||||
msgid "" |
msgid "" |
||||
"If the user wants to input a multi-word argument, they have to quote it " |
"If the user wants to input a multi-word argument, they have to quote it like" |
||||
"like earlier:" |
" earlier:" |
||||
msgstr "" |
msgstr "複数単語の文字列を渡す際は、引用符で囲んでください。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:127 |
#: ../../ext/commands/commands.rst:127 |
||||
msgid "" |
msgid "" |
||||
@ -162,24 +175,27 @@ msgstr "" |
|||||
#: ../../ext/commands/commands.rst:132 |
#: ../../ext/commands/commands.rst:132 |
||||
msgid "" |
msgid "" |
||||
"Since the ``args`` variable is a `tuple " |
"Since the ``args`` variable is a `tuple " |
||||
"<https://docs.python.org/3/library/stdtypes.html#sequence-types-list-" |
"<https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-" |
||||
"tuple-range>`_, you can do anything you would usually do with one." |
"range>`_, you can do anything you would usually do with one." |
||||
msgstr "" |
msgstr "" |
||||
|
"また、 ``args`` は `tuple <https://docs.python.org/3/library/stdtypes.html" |
||||
|
"#sequence-types-list-tuple-range>`_ のため、通常これ一つで大抵のことは行うことができます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:136 |
#: ../../ext/commands/commands.rst:136 |
||||
msgid "Keyword-Only Arguments" |
msgid "Keyword-Only Arguments" |
||||
msgstr "" |
msgstr "キーワード引数" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:138 |
#: ../../ext/commands/commands.rst:138 |
||||
msgid "" |
msgid "" |
||||
"When you want to handle parsing of the argument yourself or do not feel " |
"When you want to handle parsing of the argument yourself or do not feel like" |
||||
"like you want to wrap multi-word user input into quotes, you can ask the " |
" you want to wrap multi-word user input into quotes, you can ask the library" |
||||
"library to give you the rest as a single argument. We do this by using a " |
" to give you the rest as a single argument. We do this by using a **keyword-" |
||||
"**keyword-only argument**, seen below:" |
"only argument**, seen below:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:150 |
#: ../../ext/commands/commands.rst:150 |
||||
msgid "You can only have one keyword-only argument due to parsing ambiguities." |
msgid "" |
||||
|
"You can only have one keyword-only argument due to parsing ambiguities." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:152 |
#: ../../ext/commands/commands.rst:152 |
||||
@ -192,8 +208,8 @@ 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 " |
"By default, the keyword-only arguments are stripped of white space to make " |
||||
"make it easier to work with. This behaviour can be toggled by the " |
"it easier to work with. This behaviour can be toggled by the " |
||||
":attr:`.Command.rest_is_raw` argument in the decorator." |
":attr:`.Command.rest_is_raw` argument in the decorator." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
@ -203,43 +219,48 @@ 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, " |
"As seen earlier, every command must take at least a single parameter, called" |
||||
"called the :class:`~ext.commands.Context`." |
" the :class:`~ext.commands.Context`." |
||||
msgstr "" |
msgstr "" |
||||
|
"前述の通り、すべてのコマンドは、必ず :class:`~ext.commands.Context` と呼ばれるパラメータを受け取らなければいけません。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:170 |
#: ../../ext/commands/commands.rst:170 |
||||
msgid "" |
msgid "" |
||||
"This parameter gives you access to something called the \"invocation " |
"This parameter gives you access to something called the \"invocation " |
||||
"context\". Essentially all the information you need to know how the " |
"context\". Essentially all the information you need to know how the command " |
||||
"command was executed. It contains a lot of useful information:" |
"was executed. It contains a lot of useful information:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:173 |
#: ../../ext/commands/commands.rst:173 |
||||
msgid ":attr:`.Context.guild` to fetch the :class:`Guild` of the command, if any." |
msgid "" |
||||
msgstr "" |
":attr:`.Context.guild` to fetch the :class:`Guild` of the command, if any." |
||||
|
msgstr "存在する場合に限り、コマンドの :class:`Guild` を取得する :attr:`.Context.guild` 。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:174 |
#: ../../ext/commands/commands.rst:174 |
||||
msgid ":attr:`.Context.message` to fetch the :class:`Message` of the command." |
msgid ":attr:`.Context.message` to fetch the :class:`Message` of the command." |
||||
msgstr "" |
msgstr "コマンドの :class:`Message` を取得する :attr:`.Context.message` 。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:175 |
#: ../../ext/commands/commands.rst:175 |
||||
msgid "" |
msgid "" |
||||
":attr:`.Context.author` to fetch the :class:`Member` or :class:`User` " |
":attr:`.Context.author` to fetch the :class:`Member` or :class:`User` that " |
||||
"that called the command." |
"called the command." |
||||
msgstr "" |
msgstr "" |
||||
|
"コマンドを実行した :class:`Member` あるいは :class:`User` を取得する :attr:`.Context.author` 。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:176 |
#: ../../ext/commands/commands.rst:176 |
||||
msgid "" |
msgid "" |
||||
":meth:`.Context.send` to send a message to the channel the command was " |
":meth:`.Context.send` to send a message to the channel the command was used " |
||||
"used in." |
"in." |
||||
msgstr "" |
msgstr "コマンドが実行されたチャンネルにメッセージを送信する :meth:`.Context.send` 。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:178 |
#: ../../ext/commands/commands.rst:178 |
||||
msgid "" |
msgid "" |
||||
"The context implements the :class:`abc.Messageable` interface, so " |
"The context implements the :class:`abc.Messageable` interface, so anything " |
||||
"anything you can do on a :class:`abc.Messageable` you can do on the " |
"you can do on a :class:`abc.Messageable` you can do on the " |
||||
":class:`~ext.commands.Context`." |
":class:`~ext.commands.Context`." |
||||
msgstr "" |
msgstr "" |
||||
|
"コンテキストは :class:`abc.Messageable` インタフェースを実装しているため、 :class:`abc.Messageable` " |
||||
|
"上でできることは :class:`~ext.commands.Context` 上でも行うことが可能です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:182 |
#: ../../ext/commands/commands.rst:182 |
||||
msgid "Converters" |
msgid "Converters" |
||||
@ -249,8 +270,8 @@ msgstr "コンバーター" |
|||||
msgid "" |
msgid "" |
||||
"Adding bot arguments with function parameters is only the first step in " |
"Adding bot arguments with function parameters is only the first step in " |
||||
"defining your bot's command interface. To actually make use of the " |
"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 " |
"arguments, we usually want to convert the data into a target type. We call " |
||||
"call these :ref:`ext_commands_api_converters`." |
"these :ref:`ext_commands_api_converters`." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:188 |
#: ../../ext/commands/commands.rst:188 |
||||
@ -279,154 +300,167 @@ msgstr "基本的なコンバーター" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:199 |
#: ../../ext/commands/commands.rst:199 |
||||
msgid "" |
msgid "" |
||||
"At its core, a basic converter is a callable that takes in an argument " |
"At its core, a basic converter is a callable that takes in an argument and " |
||||
"and turns it into something else." |
"turns it into something else." |
||||
msgstr "" |
msgstr "基本的なコンバーターは、中核をなすものであり、受け取った引数を別のものへと変換します。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:201 |
#: ../../ext/commands/commands.rst:201 |
||||
msgid "" |
msgid "" |
||||
"For example, if we wanted to add two numbers together, we could request " |
"For example, if we wanted to add two numbers together, we could request that" |
||||
"that they are turned into integers for us by specifying the converter:" |
" they are turned into integers for us by specifying the converter:" |
||||
msgstr "" |
msgstr "例えば、二つの値を加算したい場合、コンバーターを指定することにより、受け取った値を整数型へ変換するように要求できます。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:210 |
#: ../../ext/commands/commands.rst:210 |
||||
msgid "" |
msgid "" |
||||
"We specify converters by using something called a **function " |
"We specify converters by using something called a **function annotation**. " |
||||
"annotation**. This is a Python 3 exclusive feature that was introduced in" |
"This is a Python 3 exclusive feature that was introduced in :pep:`3107`." |
||||
" :pep:`3107`." |
|
||||
msgstr "" |
msgstr "" |
||||
|
"コンバーターの指定には関数アノテーションというもの用います。これは :pep:`3107` にて追加された Python 3 " |
||||
|
"にのみ実装されている機能です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:213 |
#: ../../ext/commands/commands.rst:213 |
||||
msgid "" |
msgid "" |
||||
"This works with any callable, such as a function that would convert a " |
"This works with any callable, such as a function that would convert a string" |
||||
"string to all upper-case:" |
" to all upper-case:" |
||||
msgstr "" |
msgstr "これは、文字列をすべて大文字に変換する関数などといった、任意の呼び出し可能関数でも動作します。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:227 |
#: ../../ext/commands/commands.rst:227 |
||||
msgid "Advanced Converters" |
msgid "Advanced Converters" |
||||
msgstr "" |
msgstr "応用的なコンバーター" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:229 |
#: ../../ext/commands/commands.rst:229 |
||||
msgid "" |
msgid "" |
||||
"Sometimes a basic converter doesn't have enough information that we need." |
"Sometimes a basic converter doesn't have enough information that we need. " |
||||
" For example, sometimes we want to get some information from the " |
"For example, sometimes we want to get some information from the " |
||||
":class:`Message` that called the command or we want to do some " |
":class:`Message` that called the command or we want to do some asynchronous " |
||||
"asynchronous processing." |
"processing." |
||||
msgstr "" |
msgstr "" |
||||
|
"場合によっては、基本的なコンバーターを動かすのに必要な情報が不足していることがあります。例えば、実行されたコマンドの :class:`Message` " |
||||
|
"から情報を取得したい場合や、非同期処理を行いたい場合です。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:232 |
#: ../../ext/commands/commands.rst:232 |
||||
msgid "" |
msgid "" |
||||
"For this, the library provides the :class:`~ext.commands.Converter` " |
"For this, the library provides the :class:`~ext.commands.Converter` " |
||||
"interface. This allows you to have access to the :class:`.Context` and " |
"interface. This allows you to have access to the :class:`.Context` and have " |
||||
"have the callable be asynchronous. Defining a custom converter using this" |
"the callable be asynchronous. Defining a custom converter using this " |
||||
" interface requires overriding a single method, " |
"interface requires overriding a single method, :meth:`.Converter.convert`." |
||||
":meth:`.Converter.convert`." |
|
||||
msgstr "" |
msgstr "" |
||||
|
"そういった用途のために、このライブラリは :class:`~ext.commands.Converter` インタフェースを提供します。これによって " |
||||
|
":class:`.Context` " |
||||
|
"にアクセスが可能になり、また、呼び出し可能関数を非同期にもできるようになります。このインタフェースを使用して、カスタムコンバーターを定義したい場合は " |
||||
|
":meth:`.Converter.convert` をオーバーライドしてください。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:236 |
#: ../../ext/commands/commands.rst:236 |
||||
msgid "An example converter:" |
msgid "An example converter:" |
||||
msgstr "" |
msgstr "コンバーターの例" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:251 |
#: ../../ext/commands/commands.rst:251 |
||||
msgid "" |
msgid "" |
||||
"The converter provided can either be constructed or not. Essentially " |
"The converter provided can either be constructed or not. Essentially these " |
||||
"these two are equivalent:" |
"two are equivalent:" |
||||
msgstr "" |
msgstr "コンバーターはインスタンス化されていなくても構いません。以下の例の二つのは同じ処理になります。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:265 |
#: ../../ext/commands/commands.rst:265 |
||||
msgid "" |
msgid "" |
||||
"Having the possibility of the converter be constructed allows you to set " |
"Having the possibility of the converter be constructed allows you to set up " |
||||
"up some state in the converter's ``__init__`` for fine tuning the " |
"some state in the converter's ``__init__`` for fine tuning the converter. An" |
||||
"converter. An example of this is actually in the library, " |
" example of this is actually in the library, " |
||||
":class:`~ext.commands.clean_content`." |
":class:`~ext.commands.clean_content`." |
||||
msgstr "" |
msgstr "" |
||||
|
"コンバーターをインスタンス化する可能性がある場合、コンバーターの調整を行うために ``__init__`` " |
||||
|
"で何かしらの状態を設定することが出来ます。この例としてライブラリに実際に存在する " |
||||
|
":class:`~ext.commands.clean_content` があります。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:281 |
#: ../../ext/commands/commands.rst:281 |
||||
msgid "" |
msgid "" |
||||
"If a converter fails to convert an argument to its designated target " |
"If a converter fails to convert an argument to its designated target type, " |
||||
"type, the :exc:`.BadArgument` exception must be raised." |
"the :exc:`.BadArgument` exception must be raised." |
||||
msgstr "" |
msgstr "コンバーターが渡された引数を指定の型に変換できなかった場合は :exc:`.BadArgument` を発生させてください。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:285 |
#: ../../ext/commands/commands.rst:285 |
||||
msgid "Discord Converters" |
msgid "Discord Converters" |
||||
msgstr "" |
msgstr "Discord コンバーター" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:287 |
#: ../../ext/commands/commands.rst:287 |
||||
msgid "" |
msgid "" |
||||
"Working with :ref:`discord_api_models` is a fairly common thing when " |
"Working with :ref:`discord_api_models` is a fairly common thing when " |
||||
"defining commands, as a result the library makes working with them easy." |
"defining commands, as a result the library makes working with them easy." |
||||
msgstr "" |
msgstr "" |
||||
|
":ref:`discord_api_models` " |
||||
|
"を使用して作業を行うのは、コマンドを定義する際には一般的なことです。そのため、このライブラリでは簡単に作業が行えるようになっています。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:290 |
#: ../../ext/commands/commands.rst:290 |
||||
msgid "" |
msgid "" |
||||
"For example, to receive a :class:`Member`, you can just pass it as a " |
"For example, to receive a :class:`Member`, you can just pass it as a " |
||||
"converter:" |
"converter:" |
||||
msgstr "" |
msgstr "例えば、 :class:`Member` を受け取るには、これをコンバーターとして渡すだけです。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:298 |
#: ../../ext/commands/commands.rst:298 |
||||
msgid "" |
msgid "" |
||||
"When this command is executed, it attempts to convert the string given " |
"When this command is executed, it attempts to convert the string given into " |
||||
"into a :class:`Member` and then passes it as a parameter for the " |
"a :class:`Member` and then passes it as a parameter for the function. This " |
||||
"function. This works by checking if the string is a mention, an ID, a " |
"works by checking if the string is a mention, an ID, a nickname, a username " |
||||
"nickname, a username + discriminator, or just a regular username. The " |
"+ discriminator, or just a regular username. The default set of converters " |
||||
"default set of converters have been written to be as easy to use as " |
"have been written to be as easy to use as possible." |
||||
"possible." |
|
||||
msgstr "" |
msgstr "" |
||||
|
"このコマンドが実行されると、与えられた文字列を :class:`Member` " |
||||
|
"に変換して、それを関数のパラメーターとして渡します。これは文字列がメンション、ID、ニックネーム、ユーザー名 + " |
||||
|
"Discordタグ、または普通のユーザー名かどうかをチェックすることで機能しています。デフォルトで定義されているコンバーターは、できるだけ簡単に使えるように作られています。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:302 |
#: ../../ext/commands/commands.rst:302 |
||||
msgid "A lot of discord models work out of the gate as a parameter:" |
msgid "A lot of discord models work out of the gate as a parameter:" |
||||
msgstr "" |
msgstr "Discordモデルの多くがコンバーターとして動作します。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:304 ../../ext/commands/commands.rst:325 |
#: ../../ext/commands/commands.rst:304 ../../ext/commands/commands.rst:325 |
||||
msgid ":class:`Member`" |
msgid ":class:`Member`" |
||||
msgstr "" |
msgstr ":class:`Member`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:305 ../../ext/commands/commands.rst:327 |
#: ../../ext/commands/commands.rst:305 ../../ext/commands/commands.rst:327 |
||||
msgid ":class:`User`" |
msgid ":class:`User`" |
||||
msgstr "" |
msgstr ":class:`User`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:306 ../../ext/commands/commands.rst:329 |
#: ../../ext/commands/commands.rst:306 ../../ext/commands/commands.rst:329 |
||||
msgid ":class:`TextChannel`" |
msgid ":class:`TextChannel`" |
||||
msgstr "" |
msgstr ":class:`TextChannel`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:307 ../../ext/commands/commands.rst:331 |
#: ../../ext/commands/commands.rst:307 ../../ext/commands/commands.rst:331 |
||||
#: ../../ext/commands/commands.rst:333 |
#: ../../ext/commands/commands.rst:333 |
||||
msgid ":class:`VoiceChannel`" |
msgid ":class:`VoiceChannel`" |
||||
msgstr "" |
msgstr ":class:`VoiceChannel`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:308 |
#: ../../ext/commands/commands.rst:308 |
||||
msgid ":class:`CategoryChannel`" |
msgid ":class:`CategoryChannel`" |
||||
msgstr "" |
msgstr ":class:`CategoryChannel`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:309 ../../ext/commands/commands.rst:335 |
#: ../../ext/commands/commands.rst:309 ../../ext/commands/commands.rst:335 |
||||
msgid ":class:`Role`" |
msgid ":class:`Role`" |
||||
msgstr "" |
msgstr ":class:`Role`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:310 ../../ext/commands/commands.rst:337 |
#: ../../ext/commands/commands.rst:310 ../../ext/commands/commands.rst:337 |
||||
msgid ":class:`Invite`" |
msgid ":class:`Invite`" |
||||
msgstr "" |
msgstr ":class:`Invite`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:311 ../../ext/commands/commands.rst:339 |
#: ../../ext/commands/commands.rst:311 ../../ext/commands/commands.rst:339 |
||||
msgid ":class:`Game`" |
msgid ":class:`Game`" |
||||
msgstr "" |
msgstr ":class:`Game`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:312 ../../ext/commands/commands.rst:341 |
#: ../../ext/commands/commands.rst:312 ../../ext/commands/commands.rst:341 |
||||
msgid ":class:`Emoji`" |
msgid ":class:`Emoji`" |
||||
msgstr "" |
msgstr ":class:`Emoji`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:313 ../../ext/commands/commands.rst:343 |
#: ../../ext/commands/commands.rst:313 ../../ext/commands/commands.rst:343 |
||||
msgid ":class:`PartialEmoji`" |
msgid ":class:`PartialEmoji`" |
||||
msgstr "" |
msgstr ":class:`PartialEmoji`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:314 ../../ext/commands/commands.rst:345 |
#: ../../ext/commands/commands.rst:314 ../../ext/commands/commands.rst:345 |
||||
msgid ":class:`Colour`" |
msgid ":class:`Colour`" |
||||
msgstr "" |
msgstr ":class:`Colour`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:316 |
#: ../../ext/commands/commands.rst:316 |
||||
msgid "" |
msgid "" |
||||
"Having any of these set as the converter will intelligently convert the " |
"Having any of these set as the converter will intelligently convert the " |
||||
"argument to the appropriate target type you specify." |
"argument to the appropriate target type you specify." |
||||
msgstr "" |
msgstr "これらをコンバーターとして設定すると、引数を指定した型へとインテリジェントに変換します。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:319 |
#: ../../ext/commands/commands.rst:319 |
||||
msgid "" |
msgid "" |
||||
@ -434,63 +468,65 @@ msgid "" |
|||||
":ref:`ext_commands_adv_converters` interface. A table of the equivalent " |
":ref:`ext_commands_adv_converters` interface. A table of the equivalent " |
||||
"converter is given below:" |
"converter is given below:" |
||||
msgstr "" |
msgstr "" |
||||
|
"これらは :ref:`ext_commands_adv_converters` " |
||||
|
"インタフェースによって実装されています。コンバーターとクラスの関係は以下の通りです。" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:323 |
#: ../../ext/commands/commands.rst:323 |
||||
msgid "Discord Class" |
msgid "Discord Class" |
||||
msgstr "" |
msgstr "Discord クラス" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:323 |
#: ../../ext/commands/commands.rst:323 |
||||
msgid "Converter" |
msgid "Converter" |
||||
msgstr "" |
msgstr "コンバーター" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:325 |
#: ../../ext/commands/commands.rst:325 |
||||
msgid ":class:`~ext.commands.MemberConverter`" |
msgid ":class:`~ext.commands.MemberConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.MemberConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:327 |
#: ../../ext/commands/commands.rst:327 |
||||
msgid ":class:`~ext.commands.UserConverter`" |
msgid ":class:`~ext.commands.UserConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.UserConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:329 |
#: ../../ext/commands/commands.rst:329 |
||||
msgid ":class:`~ext.commands.TextChannelConverter`" |
msgid ":class:`~ext.commands.TextChannelConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.TextChannelConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:331 |
#: ../../ext/commands/commands.rst:331 |
||||
msgid ":class:`~ext.commands.VoiceChannelConverter`" |
msgid ":class:`~ext.commands.VoiceChannelConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.VoiceChannelConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:333 |
#: ../../ext/commands/commands.rst:333 |
||||
msgid ":class:`~ext.commands.CategoryChannelConverter`" |
msgid ":class:`~ext.commands.CategoryChannelConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.CategoryChannelConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:335 |
#: ../../ext/commands/commands.rst:335 |
||||
msgid ":class:`~ext.commands.RoleConverter`" |
msgid ":class:`~ext.commands.RoleConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.RoleConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:337 |
#: ../../ext/commands/commands.rst:337 |
||||
msgid ":class:`~ext.commands.InviteConverter`" |
msgid ":class:`~ext.commands.InviteConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.InviteConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:339 |
#: ../../ext/commands/commands.rst:339 |
||||
msgid ":class:`~ext.commands.GameConverter`" |
msgid ":class:`~ext.commands.GameConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.GameConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:341 |
#: ../../ext/commands/commands.rst:341 |
||||
msgid ":class:`~ext.commands.EmojiConverter`" |
msgid ":class:`~ext.commands.EmojiConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.EmojiConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:343 |
#: ../../ext/commands/commands.rst:343 |
||||
msgid ":class:`~ext.commands.PartialEmojiConverter`" |
msgid ":class:`~ext.commands.PartialEmojiConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.PartialEmojiConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:345 |
#: ../../ext/commands/commands.rst:345 |
||||
msgid ":class:`~ext.commands.ColourConverter`" |
msgid ":class:`~ext.commands.ColourConverter`" |
||||
msgstr "" |
msgstr ":class:`~ext.commands.ColourConverter`" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:348 |
#: ../../ext/commands/commands.rst:348 |
||||
msgid "" |
msgid "" |
||||
"By providing the converter it allows us to use them as building blocks " |
"By providing the converter it allows us to use them as building blocks for " |
||||
"for another converter:" |
"another converter:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:363 |
#: ../../ext/commands/commands.rst:363 |
||||
@ -499,8 +535,8 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:365 |
#: ../../ext/commands/commands.rst:365 |
||||
msgid "" |
msgid "" |
||||
"If we don't want to inherit from :class:`~ext.commands.Converter`, we can" |
"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 " |
"still provide a converter that has the advanced functionalities of an " |
||||
"advanced converter and save us from specifying two types." |
"advanced converter and save us from specifying two types." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
@ -512,42 +548,37 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:394 |
#: ../../ext/commands/commands.rst:394 |
||||
msgid "" |
msgid "" |
||||
"This can get tedious, so an inline advanced converter is possible through" |
"This can get tedious, so an inline advanced converter is possible through a " |
||||
" a ``classmethod`` inside the type:" |
"``classmethod`` inside the type:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:423 |
|
||||
#, fuzzy |
|
||||
msgid "Special Converters" |
|
||||
msgstr "基本的なコンバーター" |
|
||||
|
|
||||
#: ../../ext/commands/commands.rst:425 |
#: ../../ext/commands/commands.rst:425 |
||||
msgid "" |
msgid "" |
||||
"The command extension also has support for certain converters to allow " |
"The command extension also has support for certain converters to allow for " |
||||
"for more advanced and intricate use cases that go beyond the generic " |
"more advanced and intricate use cases that go beyond the generic linear " |
||||
"linear parsing. These converters allow you to introduce some more relaxed" |
"parsing. These converters allow you to introduce some more relaxed and " |
||||
" and dynamic grammar to your commands in an easy to use manner." |
"dynamic grammar to your commands in an easy to use manner." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:430 |
#: ../../ext/commands/commands.rst:430 |
||||
msgid "typing.Union" |
msgid "typing.Union" |
||||
msgstr "" |
msgstr "typing.Union" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:432 |
#: ../../ext/commands/commands.rst:432 |
||||
msgid "" |
msgid "" |
||||
"A :data:`typing.Union` is a special type hint that allows for the command" |
"A :data:`typing.Union` is a special type hint that allows for the command to" |
||||
" to take in any of the specific types instead of a singular type. For " |
" take in any of the specific types instead of a singular type. For example, " |
||||
"example, given the following:" |
"given the following:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:444 |
#: ../../ext/commands/commands.rst:444 |
||||
msgid "" |
msgid "" |
||||
"The ``what`` parameter would either take a :class:`discord.TextChannel` " |
"The ``what`` parameter would either take a :class:`discord.TextChannel` " |
||||
"converter or a :class:`discord.Member` converter. The way this works is " |
"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 " |
"through a left-to-right order. It first attempts to convert the input to a " |
||||
"a :class:`discord.TextChannel`, and if it fails it tries to convert it to" |
":class:`discord.TextChannel`, and if it fails it tries to convert it to a " |
||||
" a :class:`discord.Member`. If all converters fail, then a special error " |
":class:`discord.Member`. If all converters fail, then a special error is " |
||||
"is raised, :exc:`~ext.commands.BadUnionArgument`." |
"raised, :exc:`~ext.commands.BadUnionArgument`." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:449 |
#: ../../ext/commands/commands.rst:449 |
||||
@ -558,16 +589,15 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:452 |
#: ../../ext/commands/commands.rst:452 |
||||
msgid "typing.Optional" |
msgid "typing.Optional" |
||||
msgstr "" |
msgstr "typing.Optional" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:454 |
#: ../../ext/commands/commands.rst:454 |
||||
msgid "" |
msgid "" |
||||
"A :data:`typing.Optional` is a special type hint that allows for \"back-" |
"A :data:`typing.Optional` is a special type hint that allows for \"back-" |
||||
"referencing\" behaviour. If the converter fails to parse into the " |
"referencing\" behaviour. If the converter fails to parse into the specified " |
||||
"specified type, the parser will skip the parameter and then either " |
"type, the parser will skip the parameter and then either ``None`` or the " |
||||
"``None`` or the specified default will be passed into the parameter " |
"specified default will be passed into the parameter instead. The parser will" |
||||
"instead. The parser will then continue on to the next parameters and " |
" then continue on to the next parameters and converters, if any." |
||||
"converters, if any." |
|
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:458 ../../ext/commands/commands.rst:485 |
#: ../../ext/commands/commands.rst:458 ../../ext/commands/commands.rst:485 |
||||
@ -576,9 +606,9 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:471 |
#: ../../ext/commands/commands.rst:471 |
||||
msgid "" |
msgid "" |
||||
"In this example, since the argument could not be converted into an " |
"In this example, since the argument could not be converted into an ``int``, " |
||||
"``int``, the default of ``99`` is passed and the parser resumes handling," |
"the default of ``99`` is passed and the parser resumes handling, which in " |
||||
" which in this case would be to pass it into the ``liquid`` parameter." |
"this case would be to pass it into the ``liquid`` parameter." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:476 |
#: ../../ext/commands/commands.rst:476 |
||||
@ -594,9 +624,9 @@ msgstr "" |
|||||
#: ../../ext/commands/commands.rst:481 |
#: ../../ext/commands/commands.rst:481 |
||||
msgid "" |
msgid "" |
||||
"The :data:`~ext.commands.Greedy` converter is a generalisation of the " |
"The :data:`~ext.commands.Greedy` converter is a generalisation of the " |
||||
":data:`typing.Optional` converter, except applied to a list of arguments." |
":data:`typing.Optional` converter, except applied to a list of arguments. In" |
||||
" In simple terms, this means that it tries to convert as much as it can " |
" simple terms, this means that it tries to convert as much as it can until " |
||||
"until it can't convert any further." |
"it can't convert any further." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:494 |
#: ../../ext/commands/commands.rst:494 |
||||
@ -605,14 +635,14 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:498 |
#: ../../ext/commands/commands.rst:498 |
||||
msgid "" |
msgid "" |
||||
"The type passed when using this converter depends on the parameter type " |
"The type passed when using this converter depends on the parameter type that" |
||||
"that it is being attached to:" |
" it is being attached to:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:500 |
#: ../../ext/commands/commands.rst:500 |
||||
msgid "" |
msgid "" |
||||
"Positional parameter types will receive either the default parameter or a" |
"Positional parameter types will receive either the default parameter or a " |
||||
" :class:`list` of the converted values." |
":class:`list` of the converted values." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:501 |
#: ../../ext/commands/commands.rst:501 |
||||
@ -633,8 +663,8 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:506 |
#: ../../ext/commands/commands.rst:506 |
||||
msgid "" |
msgid "" |
||||
"When mixed with the :data:`typing.Optional` converter you can provide " |
"When mixed with the :data:`typing.Optional` converter you can provide simple" |
||||
"simple and expressive command invocation syntaxes:" |
" and expressive command invocation syntaxes:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:521 |
#: ../../ext/commands/commands.rst:521 |
||||
@ -643,9 +673,9 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:531 |
#: ../../ext/commands/commands.rst:531 |
||||
msgid "" |
msgid "" |
||||
"The usage of :data:`~ext.commands.Greedy` and :data:`typing.Optional` are" |
"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 " |
"powerful and useful, however as a price, they open you up to some parsing " |
||||
"parsing ambiguities that might surprise some people." |
"ambiguities that might surprise some people." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:534 |
#: ../../ext/commands/commands.rst:534 |
||||
@ -653,11 +683,10 @@ msgid "" |
|||||
"For example, a signature expecting a :data:`typing.Optional` of a " |
"For example, a signature expecting a :data:`typing.Optional` of a " |
||||
":class:`discord.Member` followed by a :class:`int` could catch a member " |
":class:`discord.Member` followed by a :class:`int` could catch a member " |
||||
"named after a number due to the different ways a " |
"named after a number due to the different ways a " |
||||
":class:`~ext.commands.MemberConverter` decides to fetch members. You " |
":class:`~ext.commands.MemberConverter` decides to fetch members. You should " |
||||
"should take care to not introduce unintended parsing ambiguities in your " |
"take care to not introduce unintended parsing ambiguities in your code. One " |
||||
"code. One technique would be to clamp down the expected syntaxes allowed " |
"technique would be to clamp down the expected syntaxes allowed through " |
||||
"through custom converters or reordering the parameters to minimise " |
"custom converters or reordering the parameters to minimise clashes." |
||||
"clashes." |
|
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:540 |
#: ../../ext/commands/commands.rst:540 |
||||
@ -673,45 +702,45 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:548 |
#: ../../ext/commands/commands.rst:548 |
||||
msgid "" |
msgid "" |
||||
"When our commands fail to either parse we will, by default, receive a " |
"When our commands fail to either parse we will, by default, receive a noisy " |
||||
"noisy error in ``stderr`` of our console that tells us that an error has " |
"error in ``stderr`` of our console that tells us that an error has happened " |
||||
"happened and has been silently ignored." |
"and has been silently ignored." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:551 |
#: ../../ext/commands/commands.rst:551 |
||||
msgid "" |
msgid "" |
||||
"In order to handle our errors, we must use something called an error " |
"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`" |
"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 " |
"which works like any other event in the :ref:`discord-api-events`. This " |
||||
"global error handler is called for every error reached." |
"global error handler is called for every error reached." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:555 |
#: ../../ext/commands/commands.rst:555 |
||||
msgid "" |
msgid "" |
||||
"Most of the time however, we want to handle an error local to the command" |
"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 " |
"itself. Luckily, commands come with local error handlers that allow us to do" |
||||
"to do just that. First we decorate an error handler function with " |
" just that. First we decorate an error handler function with " |
||||
":meth:`.Command.error`:" |
":meth:`.Command.error`:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:571 |
#: ../../ext/commands/commands.rst:571 |
||||
msgid "" |
msgid "" |
||||
"The first parameter of the error handler is the :class:`.Context` while " |
"The first parameter of the error handler is the :class:`.Context` while the " |
||||
"the second one is an exception that is derived from " |
"second one is an exception that is derived from " |
||||
":exc:`~ext.commands.CommandError`. A list of errors is found in the " |
":exc:`~ext.commands.CommandError`. A list of errors is found in the " |
||||
":ref:`ext_commands_api_errors` page of the documentation." |
":ref:`ext_commands_api_errors` page of the documentation." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:575 |
#: ../../ext/commands/commands.rst:575 |
||||
msgid "Checks" |
msgid "Checks" |
||||
msgstr "" |
msgstr "チェック" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:577 |
#: ../../ext/commands/commands.rst:577 |
||||
msgid "" |
msgid "" |
||||
"There are cases when we don't want a user to use our commands. They don't" |
"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 " |
"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 " |
"earlier. The commands extension comes with full support for these things in " |
||||
"in a concept called a :ref:`ext_commands_api_checks`." |
"a concept called a :ref:`ext_commands_api_checks`." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:581 |
#: ../../ext/commands/commands.rst:581 |
||||
@ -730,8 +759,8 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:586 |
#: ../../ext/commands/commands.rst:586 |
||||
msgid "" |
msgid "" |
||||
"Raise a :exc:`~ext.commands.CommandError` derived exception to signal the" |
"Raise a :exc:`~ext.commands.CommandError` derived exception to signal the " |
||||
" person cannot run the command." |
"person cannot run the command." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:588 |
#: ../../ext/commands/commands.rst:588 |
||||
@ -742,16 +771,15 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:591 |
#: ../../ext/commands/commands.rst:591 |
||||
msgid "" |
msgid "" |
||||
"To register a check for a command, we would have two ways of doing so. " |
"To register a check for a command, we would have two ways of doing so. The " |
||||
"The first is using the :meth:`~ext.commands.check` decorator. For " |
"first is using the :meth:`~ext.commands.check` decorator. For example:" |
||||
"example:" |
|
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:605 |
#: ../../ext/commands/commands.rst:605 |
||||
msgid "" |
msgid "" |
||||
"This would only evaluate the command if the function ``is_owner`` returns" |
"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 " |
"``True``. Sometimes we re-use a check often and want to split it into its " |
||||
"its own decorator. To do that we can just add another level of depth:" |
"own decorator. To do that we can just add another level of depth:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:622 |
#: ../../ext/commands/commands.rst:622 |
||||
@ -766,45 +794,44 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:647 |
#: ../../ext/commands/commands.rst:647 |
||||
msgid "" |
msgid "" |
||||
"If any of those checks fail in the example above, then the command will " |
"If any of those checks fail in the example above, then the command will not " |
||||
"not be run." |
"be run." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:649 |
#: ../../ext/commands/commands.rst:649 |
||||
msgid "" |
msgid "" |
||||
"When an error happens, the error is propagated to the :ref:`error " |
"When an error happens, the error is propagated to the :ref:`error handlers " |
||||
"handlers <ext_commands_error_handler>`. If you do not raise a custom " |
"<ext_commands_error_handler>`. If you do not raise a custom " |
||||
":exc:`~ext.commands.CommandError` derived exception, then it will get " |
":exc:`~ext.commands.CommandError` derived exception, then it will get " |
||||
"wrapped up into a :exc:`~ext.commands.CheckFailure` exception as so:" |
"wrapped up into a :exc:`~ext.commands.CheckFailure` exception as so:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:666 |
#: ../../ext/commands/commands.rst:666 |
||||
msgid "" |
msgid "" |
||||
"If you want a more robust error system, you can derive from the exception" |
"If you want a more robust error system, you can derive from the exception " |
||||
" and raise it instead of returning ``False``:" |
"and raise it instead of returning ``False``:" |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:691 |
#: ../../ext/commands/commands.rst:691 |
||||
msgid "" |
msgid "" |
||||
"Since having a ``guild_only`` decorator is pretty common, it comes built-" |
"Since having a ``guild_only`` decorator is pretty common, it comes built-in " |
||||
"in via :func:`~ext.commands.guild_only`." |
"via :func:`~ext.commands.guild_only`." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:694 |
#: ../../ext/commands/commands.rst:694 |
||||
msgid "Global Checks" |
msgid "Global Checks" |
||||
msgstr "" |
msgstr "グローバルチェック" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:696 |
#: ../../ext/commands/commands.rst:696 |
||||
msgid "" |
msgid "" |
||||
"Sometimes we want to apply a check to **every** command, not just certain" |
"Sometimes we want to apply a check to **every** command, not just certain " |
||||
" commands. The library supports this as well using the global check " |
"commands. The library supports this as well using the global check concept." |
||||
"concept." |
|
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:699 |
#: ../../ext/commands/commands.rst:699 |
||||
msgid "" |
msgid "" |
||||
"Global checks work similarly to regular checks except they are registered" |
"Global checks work similarly to regular checks except they are registered " |
||||
" with the :func:`.Bot.check` decorator." |
"with the :func:`.Bot.check` decorator." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
#: ../../ext/commands/commands.rst:701 |
#: ../../ext/commands/commands.rst:701 |
||||
@ -813,7 +840,6 @@ msgstr "" |
|||||
|
|
||||
#: ../../ext/commands/commands.rst:711 |
#: ../../ext/commands/commands.rst:711 |
||||
msgid "" |
msgid "" |
||||
"Be careful on how you write your global checks, as it could also lock you" |
"Be careful on how you write your global checks, as it could also lock you " |
||||
" out of your own bot." |
"out of your own bot." |
||||
msgstr "" |
msgstr "" |
||||
|
|
||||
|
File diff suppressed because it is too large
Loading…
Reference in new issue