mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-29 07:19:23 +01:00
doc/Factoids.md: improvement to mock
section
This commit is contained in:
parent
262e79ad70
commit
e166ed1e46
@ -247,6 +247,7 @@ Let's make a command, using a Code Factoid, to do this! `sm` stands for "SpongeB
|
|||||||
This time we'll use the Bash shell scripting language.
|
This time we'll use the Bash shell scripting language.
|
||||||
|
|
||||||
<pragma-> !factadd sm /code bash echo "${@,,}"|perl -pe 's/(?<!^)[[:alpha:]].*?([[:alpha:]]|$)/\L\u$&/g'
|
<pragma-> !factadd sm /code bash echo "${@,,}"|perl -pe 's/(?<!^)[[:alpha:]].*?([[:alpha:]]|$)/\L\u$&/g'
|
||||||
|
|
||||||
<pragma-> !factset sm usage Usage: sm <text>
|
<pragma-> !factset sm usage Usage: sm <text>
|
||||||
|
|
||||||
<pragma-> !sm Testing one, two...
|
<pragma-> !sm Testing one, two...
|
||||||
@ -269,6 +270,7 @@ the mock text for us.
|
|||||||
|
|
||||||
First of all, the `recall` command prints output like this:
|
First of all, the `recall` command prints output like this:
|
||||||
|
|
||||||
|
<derpy3> Girls are dumb!
|
||||||
<pragma-> !recall derpy3 girls
|
<pragma-> !recall derpy3 girls
|
||||||
<PBot> [5m30s ago] <derpy3> Girls are dumb!
|
<PBot> [5m30s ago] <derpy3> Girls are dumb!
|
||||||
|
|
||||||
@ -278,14 +280,17 @@ to strip the timestamp and the name, leaving only the message. `smr` stands for
|
|||||||
|
|
||||||
<pragma-> !factadd smr /call recall $args | {func sed s/^.*?\] (<.*?> )?(\S+:\s*)?//} | {sm}
|
<pragma-> !factadd smr /call recall $args | {func sed s/^.*?\] (<.*?> )?(\S+:\s*)?//} | {sm}
|
||||||
|
|
||||||
|
<derpy3> Girls are dumb!
|
||||||
<pragma-> !smr derpy3 girls
|
<pragma-> !smr derpy3 girls
|
||||||
<PBot> gIrLs ArE dUmB!
|
<PBot> gIrLs ArE dUmB!
|
||||||
|
|
||||||
We can make an alias with a more friendly name. By the way, if the `recall`ed
|
We can make an alias with a more friendly name.
|
||||||
message is the most recent, there is no need to use an argument (e.g., `girls`).
|
|
||||||
|
|
||||||
<pragma-> !factalias mock smr
|
<pragma-> !factalias mock smr
|
||||||
|
|
||||||
|
If the recalled message is the most recent, there is no need to use an argument (e.g., `girls`).
|
||||||
|
|
||||||
|
<derpy3> Girls are dumb!
|
||||||
<pragma-> !mock derpy3
|
<pragma-> !mock derpy3
|
||||||
<PBot> gIrLs ArE dUmB!
|
<PBot> gIrLs ArE dUmB!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user