chore: added showWinnerBroadcastMessage

This commit is contained in:
Davide Fantino 2023-01-20 01:05:29 +01:00
parent 4c3b2ee895
commit 8b73967b96
2 changed files with 14 additions and 1 deletions

View File

@ -162,6 +162,13 @@ Message that is sent as broadcast to announce the winning layer.
```json ```json
"✯ MAPVOTE ✯\nThe winning layer is\n\n" "✯ MAPVOTE ✯\nThe winning layer is\n\n"
``` ```
#### showWinnerBroadcastMessage
###### Description
Enables the broadcast at the end of the voting.
###### Default
```json
true
```
#### allowedSameMapEntries #### allowedSameMapEntries
###### Description ###### Description
Allowed max NUMBER of times a map could appear in the vote list. Allowed max NUMBER of times a map could appear in the vote list.
@ -241,6 +248,7 @@ Array of timeframes that allows to override options based on local time. See exa
"showRerollOption": false, "showRerollOption": false,
"voteBroadcastMessage": "✯ MAPVOTE ✯\nVote for the next map by writing in chat the corresponding number!", "voteBroadcastMessage": "✯ MAPVOTE ✯\nVote for the next map by writing in chat the corresponding number!",
"voteWinnerBroadcastMessage": "✯ MAPVOTE ✯\nThe winning layer is\n\n", "voteWinnerBroadcastMessage": "✯ MAPVOTE ✯\nThe winning layer is\n\n",
"showWinnerBroadcastMessage": true,
"allowedSameMapEntries": 1, "allowedSameMapEntries": 1,
"logToDiscord": true, "logToDiscord": true,
"channelID": "112233445566778899", "channelID": "112233445566778899",

View File

@ -120,6 +120,11 @@ export default class MapVote extends DiscordBasePlugin {
description: 'Message that is sent as broadcast to announce the winning layer', description: 'Message that is sent as broadcast to announce the winning layer',
default: "✯ MAPVOTE ✯\nThe winning layer is\n\n" default: "✯ MAPVOTE ✯\nThe winning layer is\n\n"
}, },
showWinnerBroadcastMessage: {
required: false,
description: 'Enables the broadcast at the end of the voting.',
default: true
},
allowedSameMapEntries: { allowedSameMapEntries: {
required: false, required: false,
description: 'Allowed NUMBER of duplicate map entries in vote list', description: 'Allowed NUMBER of duplicate map entries in vote list',
@ -648,7 +653,7 @@ export default class MapVote extends DiscordBasePlugin {
this.endVoting(); this.endVoting();
const winnerLayer = Layers.layers.find((l) => l.layerid == this.updateNextMap()); const winnerLayer = Layers.layers.find((l) => l.layerid == this.updateNextMap());
const fancyWinner = this.formatFancyLayer(winnerLayer); const fancyWinner = this.formatFancyLayer(winnerLayer);
await this.broadcast(this.options.voteWinnerBroadcastMessage + fancyWinner); if (this.showWinnerBroadcastMessage) await this.broadcast(this.options.voteWinnerBroadcastMessage + fancyWinner);
if (!this.options.logToDiscord) return if (!this.options.logToDiscord) return
return await this.sendDiscordMessage({ return await this.sendDiscordMessage({