Add option to send the link of the message
This commit is contained in:
parent
95a05eef25
commit
3fe974d3c3
@ -7,6 +7,7 @@
|
|||||||
PREFIX_ENABLED = true
|
PREFIX_ENABLED = true
|
||||||
SERVER_ID_ENABLED = false
|
SERVER_ID_ENABLED = false
|
||||||
CHANNEL_ID_ENABLED = true
|
CHANNEL_ID_ENABLED = true
|
||||||
|
MESSAGE_LINK_ENABLED = false
|
||||||
[SERVERS.COIN_REGEXES]
|
[SERVERS.COIN_REGEXES]
|
||||||
Bitcoin = "[13][a-km-zA-HJ-NP-Z1-9]{25,34}"
|
Bitcoin = "[13][a-km-zA-HJ-NP-Z1-9]{25,34}"
|
||||||
Ethereum = "0x[a-fA-F0-9]{40}"
|
Ethereum = "0x[a-fA-F0-9]{40}"
|
||||||
@ -19,6 +20,7 @@
|
|||||||
PREFIX_ENABLED = false
|
PREFIX_ENABLED = false
|
||||||
SERVER_ID_ENABLED = false
|
SERVER_ID_ENABLED = false
|
||||||
CHANNEL_ID_ENABLED = true
|
CHANNEL_ID_ENABLED = true
|
||||||
|
MESSAGE_LINK_ENABLED = false
|
||||||
[SERVERS.COIN_REGEXES]
|
[SERVERS.COIN_REGEXES]
|
||||||
Ethereum = "0x[a-fA-F0-9]{40}"
|
Ethereum = "0x[a-fA-F0-9]{40}"
|
||||||
Solana = "[1-9A-HJ-NP-Za-km-z]{32,44}"
|
Solana = "[1-9A-HJ-NP-Za-km-z]{32,44}"
|
||||||
|
5
main.go
5
main.go
@ -29,6 +29,7 @@ type ServerConfig struct {
|
|||||||
AllowDuplicates bool `toml:"ALLOW_DUPLICATES"`
|
AllowDuplicates bool `toml:"ALLOW_DUPLICATES"`
|
||||||
ServerIDEnabled bool `toml:"SERVER_ID_ENABLED"`
|
ServerIDEnabled bool `toml:"SERVER_ID_ENABLED"`
|
||||||
ChannelIDEnabled bool `toml:"CHANNEL_ID_ENABLED"`
|
ChannelIDEnabled bool `toml:"CHANNEL_ID_ENABLED"`
|
||||||
|
MessageLinkEnabled bool `toml:"MESSAGE_LINK_ENABLED"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -176,6 +177,10 @@ func formatMessage(server ServerConfig, coin, username, address, serverName stri
|
|||||||
message = fmt.Sprintf("%s (From: <#%s>)", message, m.ChannelID)
|
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
|
return message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user