From 8db0b08bf35503f152dbfc9d1e615206609b8404 Mon Sep 17 00:00:00 2001 From: Jordan Fearnley Date: Mon, 10 Oct 2016 17:27:22 +0100 Subject: [PATCH 1/3] Update Custom Reactions.md --- docs/Custom Reactions.md | 93 +++++++++++++--------------------------- 1 file changed, 30 insertions(+), 63 deletions(-) diff --git a/docs/Custom Reactions.md b/docs/Custom Reactions.md index 49e365ac..f0bfdc9a 100644 --- a/docs/Custom Reactions.md +++ b/docs/Custom Reactions.md @@ -1,69 +1,36 @@ ##Custom Reactions -

Important

- -###Commands and Their Use - - - - - - - - - - - - - - - - - - - - - -
Command NameDescriptionExample
.acrAdd 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: http://nadekobot.readthedocs.io/en/1.0/Custom Reactions/.acr "hello" Hi there, %user%!
.lcrLists 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..lcr 1
.dcrDeletes 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..dcr 5
+###Important +* For modifying **global** custom reactions, the ones which will work across all the servers your bot is connected to, you **must** be a Bot Owner.
You must also use the commands for adding, deleting and listing these reactions in a direct message with the bot. +* For modifying **local** custom reactions, the ones which will only work on the server that they are added on, require you to have the **Administrator** permission.
You must also use the commands for adding, deleting and listing these reactions in the server you want the custom reactions to work on. -

Now that we know the commands let's take a look at an example of adding a command with .acr,

-

.acr "Nice Weather" It sure is, %user%!

-

This command can be split into two different arguments:

-

Because we wanted the trigger to be more than one word, we had to wrap it with quotation marks, "Like this" 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.

-

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

+###Commands and Their Use +| Command Name | Description | Example | +|:------------:|-------------|---------| +|`.acr`|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](http://nadekobot.readthedocs.io/en/1.0/Custom%20Reactions/)|`.acr "hello" Hi there, %user%!`| +|`.lcr`|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.|`.lcr 1`| +|`.dcr`|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.|`.dcr 5`| + + +####Now that we know the commands let's take a look at an example of adding a command with `.acr`, +`.acr "Nice Weather" It sure is, %user%!` + +This command can be split into two different arguments: +* The trigger `"Nice Weather"` +* And the response, `It sure is, %user%!` + +Because we wanted the trigger to be more than one word, we had to wrap it with quotation marks, `"Like this"` 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. + +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 ###Placeholders! -

There are currently three different placeholders which we will look at, with more placeholders potentially coming in the future.

+There are currently three different placeholders which we will look at, with more placeholders potentially coming in the future. - - - - - - - - - - - - - - - - - - - - - -
PlaceholderHow the placeholder worksExamples
%mention%The %mention% placeholder is triggered when you type @botname - It's important to note that if you've given the bot a nickname, this trigger won't work!.acr "%mention% Hello" Hello! > User input: @botname Hello | Bot Replies: Hello!
%user%The %user% placeholder mentions the person who said the command.acr "Who am I" You are %user%!
%rng%The %rng% generates a random number between 0 and 10.acr Random %rng% -
- +| Placeholder | How the placeholder works | Example Usage | Input | Output | +|:-----------:|---------------------------|---------------|-------|--------| +|`%mention`|The `%mention%` placeholder is triggered when you type `@BotName` - It's important to note that if you've given the bot a custom nickname, this trigger won't work!|`.acr "Hello %mention%" I, %mention%, also say hello!`|Hello @BotName|I, @BotName, also say hello!| +|`%user%`|The `%user%` placeholder mentions the person who said the command|`.acr "Who am I?" You are %user%!`|Who am I?|You are, @Username| +|`%rng%`|The `%rng%` placeholder generates a random number between 0 and 10|`.acr "Random number" %rng%`|Random number|2| + + + Thanks to Nekai for being creative. <3 From 9561c06ad5d110d5a584a02ff90430ead04e9f65 Mon Sep 17 00:00:00 2001 From: Jordan Fearnley Date: Mon, 10 Oct 2016 17:36:23 +0100 Subject: [PATCH 2/3] Custom Reactions rewritten in Markdown It's all in markdown now, rather than HTML! Added clarification on how the placeholders are used. `%target%`'s old implementation is there as a comment, ready for it's return --- docs/Custom Reactions.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/Custom Reactions.md b/docs/Custom Reactions.md index f0bfdc9a..4849bf8b 100644 --- a/docs/Custom Reactions.md +++ b/docs/Custom Reactions.md @@ -1,7 +1,9 @@ ##Custom Reactions ###Important -* For modifying **global** custom reactions, the ones which will work across all the servers your bot is connected to, you **must** be a Bot Owner.
You must also use the commands for adding, deleting and listing these reactions in a direct message with the bot. -* For modifying **local** custom reactions, the ones which will only work on the server that they are added on, require you to have the **Administrator** permission.
You must also use the commands for adding, deleting and listing these reactions in the server you want the custom reactions to work on. +* For modifying **global** custom reactions, the ones which will work across all the servers your bot is connected to, you **must** be a Bot Owner. +You must also use the commands for adding, deleting and listing these reactions in a direct message with the bot. +* For modifying **local** custom reactions, the ones which will only work on the server that they are added on, require you to have the **Administrator** permission. +You must also use the commands for adding, deleting and listing these reactions in the server you want the custom reactions to work on. ###Commands and Their Use | Command Name | Description | Example | @@ -28,9 +30,9 @@ There are currently three different placeholders which we will look at, with mor | Placeholder | How the placeholder works | Example Usage | Input | Output | |:-----------:|---------------------------|---------------|-------|--------| |`%mention`|The `%mention%` placeholder is triggered when you type `@BotName` - It's important to note that if you've given the bot a custom nickname, this trigger won't work!|`.acr "Hello %mention%" I, %mention%, also say hello!`|Hello @BotName|I, @BotName, also say hello!| -|`%user%`|The `%user%` placeholder mentions the person who said the command|`.acr "Who am I?" You are %user%!`|Who am I?|You are, @Username| +|`%user%`|The `%user%` placeholder mentions the person who said the command|`.acr "Who am I?" You are %user%!`|Who am I?|You are @Username!| |`%rng%`|The `%rng%` placeholder generates a random number between 0 and 10|`.acr "Random number" %rng%`|Random number|2| - +[//]: # (|`%target%`|The `%target%` placeholder is used to make Nadeko Mention another person or phrase|`.acr "Say this: " %target%|Say this: I, @BotName, am a parrot!|I, @BotName, am a parrot!|) - Thanks to Nekai for being creative. <3 + Thanks to Nekai for being creative. <3 From 8f96d4cfe0bb19ade510e5f5763096defe6b1100 Mon Sep 17 00:00:00 2001 From: Jordan Fearnley Date: Mon, 10 Oct 2016 18:27:37 +0100 Subject: [PATCH 3/3] Custom reactions guide doc "fixing" Entire document is in markdown now and looks good when built with readthedocs. Did a little "housekeeping" for clarification as well. --- docs/Custom Reactions.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/Custom Reactions.md b/docs/Custom Reactions.md index 4849bf8b..d2e6f40d 100644 --- a/docs/Custom Reactions.md +++ b/docs/Custom Reactions.md @@ -17,22 +17,25 @@ You must also use the commands for adding, deleting and listing these reactions `.acr "Nice Weather" It sure is, %user%!` This command can be split into two different arguments: -* The trigger `"Nice Weather"` -* And the response, `It sure is, %user%!` -Because we wanted the trigger to be more than one word, we had to wrap it with quotation marks, `"Like this"` 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. +* The trigger, `"Nice Weather"` +* And the response, `It sure is, %user%!` -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 +An important thing to note about the triger is that, to be more than one word, we had to wrap it with quotation marks, `"Like this"` 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. + +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. + +Now, if that command was ran in a server, anyone on that server can make the bot mention them, saying `It sure is, @Username` anytime they say "Nice Weather". If the command is ran in a direct message with the bot, then the custom reaction can be used on every server the bot is connected to. ###Placeholders! There are currently three different placeholders which we will look at, with more placeholders potentially coming in the future. -| Placeholder | How the placeholder works | Example Usage | Input | Output | -|:-----------:|---------------------------|---------------|-------|--------| -|`%mention`|The `%mention%` placeholder is triggered when you type `@BotName` - It's important to note that if you've given the bot a custom nickname, this trigger won't work!|`.acr "Hello %mention%" I, %mention%, also say hello!`|Hello @BotName|I, @BotName, also say hello!| -|`%user%`|The `%user%` placeholder mentions the person who said the command|`.acr "Who am I?" You are %user%!`|Who am I?|You are @Username!| -|`%rng%`|The `%rng%` placeholder generates a random number between 0 and 10|`.acr "Random number" %rng%`|Random number|2| +| Placeholder | Description | Example Usage | Usage | +|:-----------:|-------------|---------------|-------| +|`%mention`|The `%mention%` placeholder is triggered when you type `@BotName` - It's important to note that if you've given the bot a custom nickname, this trigger won't work!|```.acr "Hello %mention%" I, %mention%, also say hello!```|Input: "Hello @BotName" Output: "I, @BotName, also say hello!"| +|`%user%`|The `%user%` placeholder mentions the person who said the command|`.acr "Who am I?" You are %user%!`|Input: "Who am I?" Output: "You are @Username!"| +|`%rng%`|The `%rng%` placeholder generates a random number between 0 and 10|`.acr "Random number" %rng%`|Input: "Random number" Output: "2"| -[//]: # (|`%target%`|The `%target%` placeholder is used to make Nadeko Mention another person or phrase|`.acr "Say this: " %target%|Say this: I, @BotName, am a parrot!|I, @BotName, am a parrot!|) +[//]: # (|`%target%`|The `%target%` placeholder is used to make Nadeko Mention another person or phrase|`.acr "Say this: " %target%|Input: "Say this: I, @BotName, am a parrot!". Output: "I, @BotName, am a parrot!".|) Thanks to Nekai for being creative. <3