mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 17:30:26 +00:00
Add UseUserName option (discord) (#234)
This commit is contained in:
parent
f2483af561
commit
67905089ba
@ -77,6 +77,7 @@ type Protocol struct {
|
|||||||
UseSASL bool // IRC
|
UseSASL bool // IRC
|
||||||
UseTLS bool // IRC
|
UseTLS bool // IRC
|
||||||
UseFirstName bool // telegram
|
UseFirstName bool // telegram
|
||||||
|
UseUserName bool // discord
|
||||||
UseInsecureURL bool // telegram
|
UseInsecureURL bool // telegram
|
||||||
WebhookBindAddress string // mattermost, slack
|
WebhookBindAddress string // mattermost, slack
|
||||||
WebhookURL string // mattermost, slack
|
WebhookURL string // mattermost, slack
|
||||||
|
@ -181,7 +181,12 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat
|
|||||||
if b.UseChannelID {
|
if b.UseChannelID {
|
||||||
rmsg.Channel = "ID:" + m.ChannelID
|
rmsg.Channel = "ID:" + m.ChannelID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !b.Config.UseUserName {
|
||||||
rmsg.Username = b.getNick(m.Author)
|
rmsg.Username = b.getNick(m.Author)
|
||||||
|
} else {
|
||||||
|
rmsg.Username = m.Author.Username
|
||||||
|
}
|
||||||
|
|
||||||
if b.Config.ShowEmbeds && m.Message.Embeds != nil {
|
if b.Config.ShowEmbeds && m.Message.Embeds != nil {
|
||||||
for _, embed := range m.Message.Embeds {
|
for _, embed := range m.Message.Embeds {
|
||||||
|
@ -443,6 +443,10 @@ Server="yourservername"
|
|||||||
#OPTIONAL (default false)
|
#OPTIONAL (default false)
|
||||||
ShowEmbeds=false
|
ShowEmbeds=false
|
||||||
|
|
||||||
|
#Shows the username (minus the discriminator) instead of the server nickname
|
||||||
|
#OPTIONAL (default false)
|
||||||
|
UseUserName=false
|
||||||
|
|
||||||
#Specify WebhookURL. If given, will relay messages using the Webhook, which gives a better look to messages.
|
#Specify WebhookURL. If given, will relay messages using the Webhook, which gives a better look to messages.
|
||||||
#OPTIONAL (default empty)
|
#OPTIONAL (default empty)
|
||||||
WebhookURL="Yourwebhooktokenhere"
|
WebhookURL="Yourwebhooktokenhere"
|
||||||
|
Loading…
Reference in New Issue
Block a user