- Java 100%
| gradle/wrapper | ||
| images | ||
| plugin/src/main | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| README.md | ||
| settings.gradle.kts | ||
Sed Aliucord Plugin
A plugin for Aliucord, which allows editing messages with a sed-like substitution command
Usage
There are two modes: basic and advanced. Basic mode is the default, advanced mode can be enabled in plugin settings.
Basic mode
Basic mode works like the feature in the web/desktop and RN clients.
s/find/replace
Sending this command in a channel will edit the newest message sent by you in the channel by replacing the first occurence of the find value with the replace value.
To use / as part of the find value, they need to be escaped with a preceding
\: \/. This does not apply to the replace value.
If the message would be empty after the edit, it gets deleted.
Advanced mode
Advanced mode is similar, but has more features. It uses regular expressions, rather than regular text.
s/find/replace[/flags]
Sending this command in a channel will edit the newest message sent by you in the channel by replacing the first match of the regular expression from the find value using the pattern from the replace value.
Regular expressions are using Java Pattern syntax, which is similar to the widely used Perl syntax.
Replacement patterns are similarly using Java Matcher.appendReplacement
syntax. This means you can use $ to reference groups, for example $1 will be
replaced with the value of the first capture group. $ can be escaped with a
preceding \.
Optionally, the flags value can be used to change the behavior of the command. The following flags are currently supported:
- g: Replace all matches, rather than only the first one.
If the message would be empty after the edit, it gets deleted.
