diff --git a/config.toml.example b/config.toml.example index d2c2135..68051a4 100644 --- a/config.toml.example +++ b/config.toml.example @@ -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}" diff --git a/main.go b/main.go index 730104a..77c3e63 100644 --- a/main.go +++ b/main.go @@ -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]())", message, m.GuildID, m.ChannelID, m.ID) + } + return message }