Merge pull request #685 from fearnlj01/1.0

Update the Custom Reactions Guide for 1.0
This commit is contained in:
Master Kwoth 2016-10-10 06:39:04 +02:00 committed by GitHub
commit 6f0a78613e

View File

@ -1,9 +1,8 @@
##Custom Reactions
<p><strong>Every time you add or remove a custom reaction you will need to restart your bot with either <code>.restart</code> if you are hosting or Nadeko is on VPS, or <code>.die</code> if Nadeko is on Droplet</strong></p>
<h3>Important</h3>
<ul style="list-style-type:disc">
<li><strong><code>.acr</code>,&nbsp;<code>.dcr</code>,&nbsp;and <code>.ecr</code> Require you to be Bot Owner</strong></li>
<li>Adding multiple commands of the same name will make Nadeko randomly select one of the command's responses</li>
<li>For modifying <strong>global</strong> custom reactions, the ones which will work across all the servers your bot is connected to, you <strong>must</strong> be a Bot Owner.<br> You must also use the commands for adding, deleting and listing these reactions in a direct message with the bot.</li>
<li>For modifying <strong>local</strong> custom reactions, the ones which will only work on the server that they are added on, require you to have the <strong>Administrator</strong> permission.<br> You must also use the commands for adding, deleting and listing these reactions in the server you want the custom reactions to work on.</li>
</ul>
###Commands and Their Use
<table>
@ -11,59 +10,60 @@
<th>Command Name</th>
<th>Description</th>
<th>Example</th>
</tr><tr>
</tr>
<tr>
<td align="center"><code>.acr</code></td>
<td>Adds a Custom Reaction</td>
<td><code>.acr Hello Hi!</code></td>
</tr><tr>
<td align="center"><code>.dcr</code></td>
<td>Deletes an entire Custom Reaction or a Specified Response Index Number</td>
<td><code>.dcr "command name"</code>&nbsp;or&nbsp;<code>.dcr "command name" 3</code></td>
</tr><tr>
<td>Add a custom reaction with a trigger and a response. Running this command in a server requries the Administrator permission. Running this command in DM is Bot Owner only, and adds a new global custom reaction. Guide here: <a href="http://nadekobot.readthedocs.io/en/1.0/Custom%20Reactions/">http://nadekobot.readthedocs.io/en/1.0/Custom Reactions/</a></td>
<td><code>.acr "hello" Hi there, %user%!</code></td>
</tr>
<tr>
<td align="center"><code>.lcr</code></td>
<td>Lists a specified page of Custom Commands</td>
<td><code>.lcr Number</code>&nbsp;i.e&nbsp;<code>.lcr 2</code></td>
</tr><tr>
<td align="center"><code>.scr</code></td>
<td>Shows all responses to a command.&nbsp;Index Number will be in brackets <code>[&nbsp;]</code></td>
<td><code>.scr Hello</code></td>
</tr><tr>
<td align="center"><code>.ecr</code></td>
<td>Edit a custom reaction, needs: reaction's name, index to change, and new multiword response.</td>
<td><code>.ecr&nbsp;Hello&nbsp;3&nbsp;What's up</code></td></table>
<h4>Now that we know the commands let's take a look at the arguments and placeholders available for <code>.acr</code>,</h4>
<p><code>.addcustreact</code>&nbsp;(<code>.acr</code>)&nbsp;takes two arguments:
<dl>
<dt><strong>&nbsp;First, The name of the command; this directly follows the <code>.acr</code></strong></dt>
<dd>-&nbsp;If your command name is more than 1 word use quotation marks;<br> i.e <del><code>.acr Nice weather sure is</code></del> > <code>.acr "Nice weather" sure is</code></dd>
<dd>-&nbsp;Now everytime someone says "Nice weather" the bot will respond with, "sure is"</dd>
<dt><strong>&nbsp;Next, The Response, this follows the name of the command.</strong><dt>
<dd>-&nbsp;i.e <code>.acr "Nice weather"</code><b><i><code>sure is</code></i></b></dd></dl><p>
###And finally on to the Placeholders
<p>There are currently four placeholders, which we will be looking at, with many more to come in the future.<p>
<td>Lists a page of global or server custom reactions (15 reactions per page). Running this command in a DM will list the global custom reactions, while running it in a server will list that server's custom reactions.</td>
<td><code>.lcr 1</code></td>
</tr>
<tr>
<td align="center"><code>.dcr</code></td>
<td>Deletes a custom reaction based on the provided index. Running this command in a server requires the Administrator permission. Running this command in DM is Bot Owner only, and will delete a global custom reaction.</td>
<td><code>.dcr 5</code></td>
</tr>
</table>
<h4>Now that we know the commands let's take a look at an example of adding a command with <code>.acr</code>,</h4>
<p><code>.acr "Nice Weather" It sure is, %user%!</code></p>
<p>This command can be split into two different arguments:<ul><li>The trigger <code>"Nice Weather"</code></li><li>And the response, <code>It sure is, %user%!</code></li></ul></p>
<p>Because we wanted the trigger to be more than one word, we had to wrap it with quotation marks, <code>"Like this"</code> otherwise, only the first word would have been recognised as the trigger, and the second word would have been recognised as part of the response.</p>
<p>There's no special requirement for the formatting of the response, so we could just write it in exactly the same way we want it to respond, albeit with a placeholder - which will be explained in this next section</p>
###Placeholders!
<p>There are currently three different placeholders which we will look at, with more placeholders potentially coming in the future.</p>
<table>
<tr>
<th>Placeholder</th>
<th>How the placeholder works</th>
<th>Examples</th>
</tr><tr>
</tr>
<tr>
<td align="center"><code>%mention%</code></td>
<td>The&nbsp;<code>%mention%</code>&nbsp;placeholder is triggered when you type <code>@botname</code></td>
<td>The&nbsp;<code>%mention%</code>&nbsp;placeholder is triggered when you type <code>@botname</code> - It's important to note that if you've given the bot a nickname, this trigger won't work!</td>
<td><code>.acr "%mention% Hello" Hello!</code> > User input: @botname Hello | Bot Replies: Hello!</td>
</tr><tr>
</tr>
<!-- <tr>
<td align="center"><code>%target%</code></td>
<td>The <code>%target%</code> placeholder is used to make Nadeko Mention another person</td>
<td><code>.acr "%mention% Hello" %target% Hi!</code> > User inputs: "@botname Hello @somebody"
Bot replies: "Hi @somebody"</td>
</tr><tr>
<td><code>.acr "Hello" %target%, Hi!</code> > User inputs: "Hello @somebody!"
Bot replies: "@somebody, Hi!"</td>
</tr> -->
<tr>
<td align="center"><code>%user%</code></td>
<td>The <code>%user%</code> placeholder mentions the person who said the command</td>
<td><code>.acr "Who am i" You are %user%!</code></td>
</tr><tr>
<td><code>.acr "Who am I" You are %user%!</code></td>
</tr>
<tr>
<td align="center"><code>%rng%</code></td>
<td>The <code>%rng%</code> generates a random number</td>
<td>The <code>%rng%</code> generates a random number between 0 and 10</td>
<td><code>.acr Random %rng%</code>
</tr></table>
Thanks to Nekai for being creative. <3
</tr>
</table>
Thanks to Nekai for being creative. <3 <!-- and to fearnlj01, for making it less creative (sorry) -->