added voteBroadcastMessage

This commit is contained in:
Davide Fantino 2022-09-16 22:41:55 +02:00
parent 09bae31e41
commit 4b0131a8e8
2 changed files with 15 additions and 2 deletions

View File

@ -97,6 +97,13 @@ vote option to restart the vote with random entries.
```json ```json
false false
``` ```
#### voteBroadcastMessage
###### Description
Message that is sent as broadcast to announce a vote.
###### Default
```
✯ MAPVOTE ✯ Vote for the next map by writing in chat the corresponding number!
```
### Example configuration ### Example configuration
```json ```json
{ {
@ -110,6 +117,7 @@ false
"gamemodeWhitelist": [ "AAS", "RAAS", "Invasion" ], "gamemodeWhitelist": [ "AAS", "RAAS", "Invasion" ],
"layerLevelBlacklist": [ "BlackCoast_Seed" ], "layerLevelBlacklist": [ "BlackCoast_Seed" ],
"hideVotesCount": false, "hideVotesCount": false,
"showRerollOption": false "showRerollOption": false,
"voteBroadcastMessage": "✯ MAPVOTE ✯ Vote for the next map by writing in chat the corresponding number!"
} }
``` ```

View File

@ -89,6 +89,11 @@ export default class MapVote extends BasePlugin {
required: false, required: false,
description: 'vote option to restart the vote with random entries', description: 'vote option to restart the vote with random entries',
default: false default: false
},
voteBroadcastMessage: {
required: false,
description: 'Message that is sent as broadcast to announce a vote',
default: "✯ MAPVOTE ✯ Vote for the next map by writing in chat the corresponding number!"
} }
}; };
} }
@ -576,7 +581,7 @@ export default class MapVote extends BasePlugin {
//Note: broadcast strings with multi lines are very strange //Note: broadcast strings with multi lines are very strange
async broadcastNominations() { async broadcastNominations() {
if (this.nominations.length > 0 && this.votingEnabled) { if (this.nominations.length > 0 && this.votingEnabled) {
await this.broadcast("✯ MAPVOTE ✯ Vote for the next map by writing in chat the corresponding number!\n"); await this.broadcast(this.options.voteBroadcastMessage);
let nominationStrings = []; let nominationStrings = [];
for (let choice = 1; choice < this.nominations.length; choice++) { for (let choice = 1; choice < this.nominations.length; choice++) {
choice = Number(choice); choice = Number(choice);