Skip to content

Commit 8567fee

Browse files
committed
Disable @here and @everyone by default
- Add option `allow_pinging_everyone`
1 parent ef4d382 commit 8567fee

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

config-example.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
// Color usernames of the discord users in factorio chat
2424
ingame_discord_user_colors: false,
2525

26+
allow_pinging_everyone: false,
27+
2628
// Send all console output to that channel
2729
enable_console_channel: false,
2830
factorio_console_chat_id: "",

discord/log.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ func processFactorioChat(line string) {
7878
if messageType == "DISCORD" || messageType == "CHAT" {
7979
if strings.Contains(line, "@") {
8080
line = AddMentions(line)
81+
if !support.Config.AllowPingingEveryone {
82+
line = strings.ReplaceAll(line, "@here", "@​here")
83+
line = strings.ReplaceAll(line, "@everyone", "@​everyone")
84+
}
8185
}
8286
}
8387
if support.Config.HaveServerEssentials {

support/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ type configT struct {
2525
HaveServerEssentials bool `json:"have_server_essentials"`
2626
IngameDiscordUserColors bool `json:"ingame_discord_user_colors"`
2727

28+
AllowPingingEveryone bool `json:"allow_pinging_everyone"`
29+
2830
EnableConsoleChannel bool `json:"enable_console_channel"`
2931
FactorioConsoleChatID string `json:"factorio_console_chat_id"`
3032

0 commit comments

Comments
 (0)