Plugin for Aliucord that allows editing messages with a sed-like substitution command.
Find a file
2024-11-01 02:38:48 +01:00
gradle/wrapper Initial commit 2024-02-17 12:11:57 +01:00
images Initial commit 2024-02-17 12:11:57 +01:00
plugin/src/main Merge escape parser states with find and replace states 2024-11-01 01:51:47 +01:00
.gitattributes Initial commit 2024-02-17 12:11:57 +01:00
.gitignore Initial commit 2024-02-17 12:11:57 +01:00
.gitlab-ci.yml Revert "Change JDK version to 11" 2024-02-27 04:05:31 +01:00
build.gradle.kts Bump the version number and add changelog 2024-11-01 01:58:00 +01:00
gradle.properties Initial commit 2024-02-17 12:11:57 +01:00
gradlew Initial commit 2024-02-17 12:11:57 +01:00
gradlew.bat Initial commit 2024-02-17 12:11:57 +01:00
LICENSE Initial commit 2024-02-17 12:11:57 +01:00
README.md Document deleting messages in README 2024-11-01 02:38:48 +01:00
settings.gradle.kts Remove reference to TextEmoji plugin 2024-02-17 15:25:26 +01:00

Sed Aliucord Plugin

A plugin for Aliucord, which allows editing messages with a sed-like substitution command

Demonstration (animated)

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.

Download