Merge branch 'hokutochen-v4-patch-19985' into 'v4'

Updated Docs regarding source and expressions along with help text

See merge request Kwoth/nadekobot!247
This commit is contained in:
Kwoth
2022-05-27 23:55:57 +00:00
8 changed files with 57 additions and 59 deletions

View File

@@ -1,23 +1,23 @@
## Custom Reactions / Expressions
## Expressions
### 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.
- For modifying **global** expressions, 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, it is required 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 **local** expressions, the ones which will only work on the server that they are added on, it is required to have the **Administrator** permission.
You must also use the commands for adding, deleting and listing these reactions in the server you want the expressions to work on.
### 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. | `.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` |
| `.exadd` | Add an expression 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 expression. | `.exadd "hello" Hi there, %user%!` |
| `exl` | Lists a page of global or server expression(15 reactions / expressions per page). Running this command in a DM will list the global expression, while running it in a server will list that server's expression. | `.exl 1` |
| `.exd` | Deletes an expression 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 expression. | `.exd 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%!`
`.exadd "Nice Weather" It sure is, %user%!`
This command can be split into two different arguments:
@@ -28,16 +28,16 @@ An important thing to note about the triger is that, to be more than one word, w
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.
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 expression can be used on every server the bot is connected to.
### Block global Custom Reactions
### Block global Expressions
If you want to disable a global custom reaction which you do not like, and you do not want to remove it, or you are not the bot owner, you can do so by adding a new Custom Reaction with the same trigger on your server, and set the response to `-`.
If you want to disable a global expression which you do not like, and you do not want to remove it, or you are not the bot owner, you can do so by adding a new expression with the same trigger on your server, and set the response to `-`.
For example:
`.acr /o/ -`
Now if you try to trigger `/o/`, it won't print anything even if there is a global custom reaction with the same name.
Now if you try to trigger `/o/`, it won't print anything even if there is a global expression with the same name.
### Placeholders!

View File

@@ -10,7 +10,7 @@ Donating to us also gives you the following benefits:
- A hoisted **Donators role** in our [Discord server][discord-server]
- Access to exclusive **#noticed** text and voice channels
- **1000 flowers** on the public bot per dollar donated (after fees)
- **Custom Reactions** on the public bot for [Patreon pledges][patreon] of $5 or higher
- **Expressions** on the public bot for [Patreon pledges][patreon] of $5 or higher
## Patreon

View File

@@ -17,8 +17,6 @@ To self-host your own Nadeko, use the guides below:
- [:material-linux: Linux guide][linux-guide]
- [:material-apple: Mac OS guide][macos-guide]
Alternatively, you may also setup the bot [from source][from-source-guide] if you want to modify the code.
In case you need any help, join our [Discord server][discord-server] where we may provide support.
---

View File

@@ -73,14 +73,14 @@ Say you want to only enable NSFW commands for a specific role, just do the follo
2. `.rm NSFW enable Lewd`
- Enables usage of the NSFW module for the Lewd role
#### How do I disable custom reactions from triggering?
#### How do I disable Expressions from triggering?
If you don't want server or global custom reactions, just block the module that controls their usage:
If you don't want server or global Expressions, just block the module that controls their usage:
1. `.sm ActualCustomReactions disable`
1. `.sm Expressions disable`
- Disables the ActualCustomReactions module from being used
**Note**: The `ActualCustomReactions` module controls the usage of custom reactions. The `CustomReactions` module controls commands related to custom reactions (such as `.acr`, `.lcr`, `.crca`, etc).
**Note**: The `Expressions` module controls the usage of Expressions. The `Expressions` module controls commands related to Expressions (such as `.acr`, `.lcr`, `.crca`, etc).
#### I've broken permissions and am stuck, can I reset permissions?

View File

@@ -1,6 +1,6 @@
# Placeholders
Placeholders are used in Quotes, Custom Reactions, Greet/Bye messages, playing statuses, and a few other places.
Placeholders are used in Quotes, Expressions, Greet/Bye messages, playing statuses, and a few other places.
They can be used to make the message more user friendly, generate random numbers or pictures, etc.
@@ -88,7 +88,7 @@ Some features have their own specific placeholders which are noted in that featu
### Miscellaneous placeholders
- `%rngX-Y%` - Returns a random number between X and Y
- `%target%` - Returns anything the user has written after the trigger (only works on custom reactions)
- `%img:stuff%` - Returns an `imgur.com` search for "stuff" (only works on custom reactions)
- `%target%` - Returns anything the user has written after the trigger (only works on Expressions)
- `%img:stuff%` - Returns an `imgur.com` search for "stuff" (only works on Expressions)
![img](https://puu.sh/B7mgI.png)

View File

@@ -1,4 +1,4 @@
#nullable disable
#nullable disable
namespace NadekoBot.Modules.NadekoExpressions;
@@ -266,8 +266,8 @@ public partial class NadekoExpressions : NadekoModule<NadekoExpressionsService>
public async partial Task ExprClear()
{
if (await PromptUserConfirmAsync(_eb.Create()
.WithTitle("Custom reaction clear")
.WithDescription("This will delete all custom reactions on this server.")))
.WithTitle("Expression clear")
.WithDescription("This will delete all expressions on this server.")))
{
var count = _service.DeleteAllExpressions(ctx.Guild.Id);
await ReplyConfirmLocalizedAsync(strs.exprs_cleared(count));
@@ -334,4 +334,4 @@ public partial class NadekoExpressions : NadekoModule<NadekoExpressionsService>
await ctx.OkAsync();
}
}
}

View File

@@ -193,13 +193,13 @@ iamnot:
args:
- "Gamer"
expradd:
desc: "Add a custom reaction with a trigger and a response. Running this command in server requires the Administration permission. Running this command in DM is Bot Owner only and adds a new global custom reaction. Guide here: <http://nadekobot.readthedocs.io/en/latest/custom-reactions/>"
desc: "Add a expression with a trigger and a response. Running this command in server requires the Administration permission. Running this command in DM is Bot Owner only and adds a new global expression. Guide here: <http://nadekobot.readthedocs.io/en/latest/custom-reactions/>"
args:
- "\"hello\" Hi there %user.mention%"
exprlist:
desc: |-
Lists global or server custom reactions (20 commands per page).
Running the command in DM will list global custom reactions, while running it in a server will list server custom reactions.
Lists global or server expressions (20 commands per page).
Running the command in DM will list global expressions, while running it in a server will list server expressions.
Shows enabled settings, followed by id, followed by the trigger.
**Settings:**
• 🗯️ Triggered if trigger matches any word (`{0}h {0}exca`)
@@ -209,15 +209,15 @@ exprlist:
- "1"
- "all"
exprshow:
desc: "Shows a custom reaction's response on a given ID."
desc: "Shows a expression's response on a given ID."
args:
- "1"
exprdelete:
desc: "Deletes a custom reaction on a specific index. If ran in DM, it is bot owner only and deletes a global custom reaction. If ran in a server, it requires Administration privileges and removes server custom reaction."
desc: "Deletes a expression on a specific index. If ran in DM, it is bot owner only and deletes a global expression. If ran in a server, it requires Administration privileges and removes server expression."
args:
- "5"
exprclear:
desc: "Deletes all custom reactions on this server."
desc: "Deletes all expression on this server."
args:
- ""
fwclear:
@@ -578,7 +578,7 @@ serverblacklist:
- ""
- "2"
cmdcooldown:
desc: "Sets a cooldown per user for a command or a custom reaction. Set it to 0 to remove the cooldown."
desc: "Sets a cooldown per user for a command or a expression. Set it to 0 to remove the cooldown."
args:
- ".h 5"
- ".pat 30"
@@ -1331,7 +1331,7 @@ listservers:
args:
- "3"
cleverbot:
desc: "Toggles cleverbot session. When enabled, the bot will reply to messages starting with bot mention in the server. Custom reactions starting with %bot.mention% won't work if cleverbot is enabled."
desc: "Toggles cleverbot session. When enabled, the bot will reply to messages starting with bot mention in the server. Expressions starting with %bot.mention% won't work if cleverbot is enabled."
args:
- ""
shorten:
@@ -1545,37 +1545,37 @@ rategirl:
args:
- "@SomeGurl"
exprreact:
desc: "Sets or resets reactions (up to 3) which will be added to the response message of the CustomReaction with the specified ID. Provide no emojis to reset."
desc: "Sets or resets reactions (up to 3) which will be added to the response message of the Expression with the specified ID. Provide no emojis to reset."
args:
- "59 \U0001F44D \U0001F44E "
- "59 <a:nFlower:408963839191941120>"
- "59"
exprad:
desc: "Toggles whether the message triggering the custom reaction will be automatically deleted."
desc: "Toggles whether the message triggering the expression will be automatically deleted."
args:
- "59"
exprat:
desc: "Toggles whether the custom reaction will allow extra input after the trigger. For example, with this feature enabled, custom reaction with trigger 'hi' will also be invoked when a user types 'hi there'. This feature is automatically enabled on custom reactions which have '%target%' in their response."
desc: "Toggles whether the expression will allow extra input after the trigger. For example, with this feature enabled, expression with trigger 'hi' will also be invoked when a user types 'hi there'. This feature is automatically enabled on expressions which have '%target%' in their response."
args:
- "59"
exprdm:
desc: "Toggles whether the response message of the custom reaction will be sent as a direct message."
desc: "Toggles whether the response message of the expression will be sent as a direct message."
args:
- "44"
exprca:
desc: "Toggles whether the custom reaction will trigger if the triggering message contains the keyword (instead of only starting with it)."
desc: "Toggles whether the expression will trigger if the triggering message contains the keyword (instead of only starting with it)."
args:
- "44"
exprsreload:
desc: "Reloads all custom reactions on all shards. Use this if you've made changes to the database while the bot is running, or used `{0}deleteunusedcrnq`"
desc: "Reloads all expressions on all shards. Use this if you've made changes to the database while the bot is running, or used `{0}deleteunusedcrnq`"
args:
- ""
exprsimport:
desc: "Upload the file or send the raw .yml data with this command to import all custom reactions from the specified string or file into the current server (or as global custom reactions in dm)"
desc: "Upload the file or send the raw .yml data with this command to import all expressions from the specified string or file into the current server (or as global expressions in dm)"
args:
- "<upload .yml file>"
exprsexport:
desc: "Exports custom reactions from the current server (or global custom reactions in DMs) into a .yml file"
desc: "Exports expressions from the current server (or global expressions in DMs) into a .yml file"
args:
- ""
quotesimport:
@@ -1953,7 +1953,7 @@ feedlist:
args:
- ""
expredit:
desc: "Edits the custom reaction's response given its ID."
desc: "Edits the expression's response given its ID."
args:
- "123 I'm a magical girl"
say:
@@ -2208,4 +2208,4 @@ bankwithdraw:
bankbalance:
desc: "Shows your current bank balance available for withdrawal."
args:
- ""
- ""

View File

@@ -1,14 +1,14 @@
{
"all_stats_cleared": "All custom reaction stats rinsed away!",
"deleted": "Got rid of that Custom Reaction",
"insuff_perms": "You don\u0027t have the perms - you hafta own me for global custom reactions, and you need Administrator for server reactions!",
"all_stats_cleared": "All expression stats rinsed away!",
"deleted": "Got rid of that Expression",
"insuff_perms": "You don\u0027t have the perms - you hafta own me for global expressions, and you need Administrator for server expressions!",
"list_all": "List of all dumb things you make me say",
"new_cust_react": "New Custom Reaction",
"new_cust_react": "New Expression",
"no_found": "You haven\u0027t forced me to say any stupid stuff yet.",
"no_found_id": "I didn\u0027t find any reaction with that ID.",
"response": "Response",
"stats": "Custom Reaction Stats",
"stats_cleared": "Rinsed away stats for {0} custom reaction.",
"stats": "Expression Stats",
"stats_cleared": "Rinsed away stats for {0} expression.",
"stats_not_found": "You want me to get stats for one without them? Really?",
"autohentai_stopped": "About time, you perv.",
"aar_disabled": "I **won\u0027t auto assign roles** anymore when a user joins!",
@@ -598,10 +598,10 @@
"vcrole_added": "Giving anyone who joins {0} voice channel {1} role, just because it\u0027s cool, and nothing else...",
"vcrole_removed": "I won\u0027t give anyone who joins {0} voice channel a role anymore.",
"vc_role_list": "Voice channel roles",
"crad_disabled": "I won\u0027t clean up triggers of the custom reaction with id {0} anymore, I guess...",
"crad_enabled": "I\u0027ll sweep up any triggers of the custom reaction with id {0}... why do I have to clean up your mess?",
"crdm_disabled": "I won\u0027t send the response from custom reaction with id {0} as a PM anymore. Phew.",
"crdm_enabled": "I\u0027ll get in someone\u0027s face for the custom reaction with id {0}\u0027s message...",
"crad_disabled": "I won\u0027t clean up triggers of the expression with id {0} anymore, I guess...",
"crad_enabled": "I\u0027ll sweep up any triggers of the expression with id {0}... why do I have to clean up your mess?",
"crdm_disabled": "I won\u0027t send the response from expression with id {0} as a PM anymore. Phew.",
"crdm_enabled": "I\u0027ll get in someone\u0027s face for the expression with id {0}\u0027s message...",
"aliases_none": "No alias found",
"alias_added": "I\u0027ll make {0} do {1} too... b-but for everyone, not just you!",
"alias_list": "List of aliases",
@@ -746,8 +746,8 @@
"stream_role_wl_rem_fail": "User {0} is not whitelisted. They are a baka after all.",
"bot_config_edit_fail": "I failed setting {0} to the value {1} , but it\u0027s all cus of you.",
"bot_config_edit_success": "Made the value {0} to {1}. Now gimme cookies.",
"crca_disabled": "Custom reaction with the id {0} will no longer get triggerd unless it\u0027s triggerd word is at the beggining of the sentence. Don\u0027t trigger it.",
"crca_enabled": "Custom reactions with the id {0} now get triggerd if it\u0027s said anywhere in the sentence. #mastertriggerd",
"crca_disabled": "Expression with the id {0} will no longer get triggerd unless it\u0027s triggerd word is at the beggining of the sentence. Don\u0027t trigger it.",
"crca_enabled": "Expressions with the id {0} now get triggerd if it\u0027s said anywhere in the sentence. #mastertriggerd",
"server_level": "Server Level, what do you really need more explanation than that? BAKA.",
"club": "Club, the thing you wanna be in but nobody wants you.",
"xp": "Experience, the thing you don\u0027t have",
@@ -791,7 +791,7 @@
"club_bans_for": "Le bans for {0} club",
"club_apps_for": "Beggars for {0} club",
"club_leaderboard": "Club leaderboard - page {0}",
"edited_cust_react": "Custom Reaction Edited. It sounded better before.",
"edited_cust_react": "Expression Edited. It sounded better before.",
"self_assign_are_exclusive": "You can only choose 1 role from each group. Don\u0027t be greedy.",
"self_assign_are_not_exclusive": "You can choose any number of roles from any group. Hmpf, so greedy.",
"self_assign_group": "Group {0}",
@@ -894,7 +894,7 @@
"reset_server": "I guess you really are like that. Everyones XP was reset.",
"distance": "You don\u0027t even know that the distance between {0} and {1} is {2}km?",
"bot_list_awarded": "Gave {0} to {1} people. Do they deserve that?",
"cleared": "All the {0} custom reactions are erased from existence!",
"cleared": "All the {0} Expressions are erased from existence!",
"fw_cleared": "Formatted all filterd words and filterd words channel settings.",
"aliases_cleared": "All {0} aliases are gone.",
"streams_cleared": "All the {0} are safley \u0022transferd\u0022 to an \u0022unkown\u0022 location.",
@@ -933,4 +933,4 @@
"new_gamestatus_event": "Type the super secret code in any of the channels to receive {1} {2} are left to be awarded! Why your reading this start typing baka!",
"event_duration_footer": "This event has been going on for {0} hours! When will this madness stop?",
"event_title": "{0} has started... Here we go again.."
}
}