ImplMessageMonitor #2

Merged
Joren merged 4 commits from ImplMessageMonitor into main 2024-06-27 12:42:37 +02:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit 3fe974d3c3 - Show all commits

View File

@ -7,6 +7,7 @@
PREFIX_ENABLED = true
SERVER_ID_ENABLED = false
CHANNEL_ID_ENABLED = true
MESSAGE_LINK_ENABLED = false
[SERVERS.COIN_REGEXES]
Bitcoin = "[13][a-km-zA-HJ-NP-Z1-9]{25,34}"
Ethereum = "0x[a-fA-F0-9]{40}"
@ -19,6 +20,7 @@
PREFIX_ENABLED = false
SERVER_ID_ENABLED = false
CHANNEL_ID_ENABLED = true
MESSAGE_LINK_ENABLED = false
[SERVERS.COIN_REGEXES]
Ethereum = "0x[a-fA-F0-9]{40}"
Solana = "[1-9A-HJ-NP-Za-km-z]{32,44}"

View File

@ -29,6 +29,7 @@ type ServerConfig struct {
AllowDuplicates bool `toml:"ALLOW_DUPLICATES"`
ServerIDEnabled bool `toml:"SERVER_ID_ENABLED"`
ChannelIDEnabled bool `toml:"CHANNEL_ID_ENABLED"`
MessageLinkEnabled bool `toml:"MESSAGE_LINK_ENABLED"`
}
func init() {
@ -176,6 +177,10 @@ func formatMessage(server ServerConfig, coin, username, address, serverName stri
message = fmt.Sprintf("%s (From: <#%s>)", message, m.ChannelID)
}
if server.MessageLinkEnabled {
message = fmt.Sprintf("%s ([Link](<https://discord.com/channels/%s/%s/%s>))", message, m.GuildID, m.ChannelID, m.ID)
}
return message
}