Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/funnyboy-roks/messenger
A plugin to send MiniMessage formatted rotating messages in chat on a scheduled interval.
https://github.com/funnyboy-roks/messenger
announcement chat hacktoberfest papermc rotating-message spigot
Last synced: about 2 months ago
JSON representation
A plugin to send MiniMessage formatted rotating messages in chat on a scheduled interval.
- Host: GitHub
- URL: https://github.com/funnyboy-roks/messenger
- Owner: funnyboy-roks
- License: apache-2.0
- Created: 2023-08-25T02:45:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-31T23:47:03.000Z (7 months ago)
- Last Synced: 2024-06-01T00:41:10.208Z (7 months ago)
- Topics: announcement, chat, hacktoberfest, papermc, rotating-message, spigot
- Language: Java
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Messenger
A plugin to send
[MiniMessage](https://docs.advntr.dev/minimessage/format.html) formatted
rotating messages in chat on a scheduled interval.## Configuration
- `duration`: integer
- Seconds between each message being sent in chat
- Default: `300` (5 minutes)
- `message-format`: string
- Format of the messages to be displayed to the user in chat. This
is used for adding a prefix or suffix to the message
- Supports [MiniMessage](https://docs.advntr.dev/minimessage/format.html)
- Default: `[+] %message%` (renders to `[+] %message%`)
- `debug-logging`: boolean
- Whether verbose logging should be printed to the console
- Default: `false`## Commands
- `/messenger `
- Main command for Messenger
- `/messenger add` - Open an editor to add a new rotating message to
the chat.
- `/messenger add ` - Add a message into the chat directly
- `/messenger reload` - Reload the plugin's configuration and
messages from the `messages.json` file.## Permissions
- `messenger.command.messenger`
- Ability to run the `/messenger` command
- Default: `op`## Data
The plugin currently only handles two files: `config.yml` and
`messages.json`.The `config.yml` holds the configuration for the plugin, see
[Configuration](#configuration) for more detailsThe `messages.json` holds each message to be printed into chat.
Removing/Adding a message from this list will remove/add it from/to the
game (After `/messenger reload` or server restart).## Message Format
A message can be formatted using
[MiniMessage](https://docs.advntr.dev/minimessage/format.html). If
`%player%` is included in the message, it will be replaced with the
player's username.## API
The plugin offers a simple API which allows for adding new messages.
To add it as a dependency if using maven, add the following to your pom.xml:
```xml
jitpack.io
https://jitpack.iocom.github.funnyboy-roks
Messenger
Tag```
Otherwise, checkout the [jitpack repo](https://jitpack.io/#funnyboy-roks/Messenger/1.0) for other systems
### Usage example
```java
// construct a new message that says "hello " + playername
// and is sent to all players
Message msg = new Message(
p -> Component.text("hello ").append(p.displayName()),
p -> true
);// Add a message to the list
Messenger.api().addMessage(msg);
```## Future To-Do
- [ ] PAPI support - If there is interest
- [ ] More configuration optionsI'm always looking for ideas, if you have any, please create an issue
and let me know!