From 75181741dabf9ded171f0c4e566b140f215d92ec Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 16 May 2023 22:13:12 +0300 Subject: [PATCH] Update default displayname template --- example-config.yaml | 5 +++-- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/example-config.yaml b/example-config.yaml index 29d1d24..0b63ec9 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -80,11 +80,12 @@ bridge: # Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled. # Available variables: # .ID - Internal user ID - # .Username - User's displayname on Discord + # .Username - Legacy display/username on Discord + # .GlobalName - New displayname on Discord # .Discriminator - The 4 numbers after the name on Discord # .Bot - Whether the user is a bot # .System - Whether the user is an official system user - displayname_template: '{{.Username}}#{{.Discriminator}}{{if .Bot}} (bot){{end}}' + displayname_template: '{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}}' # Displayname template for Discord channels (bridged as rooms, or spaces when type=4). # Available variables: # .Name - Channel name, or user displayname (pre-formatted with displayname_template) in DMs. diff --git a/go.mod b/go.mod index e3062e6..759609d 100644 --- a/go.mod +++ b/go.mod @@ -38,4 +38,4 @@ require ( maunium.net/go/mauflag v1.0.0 // indirect ) -replace github.com/bwmarrin/discordgo => github.com/beeper/discordgo v0.0.0-20230426184739-79aea97f6660 +replace github.com/bwmarrin/discordgo => github.com/beeper/discordgo v0.0.0-20230512133900-5b12693331c0 diff --git a/go.sum b/go.sum index 929f713..1aad12c 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= -github.com/beeper/discordgo v0.0.0-20230426184739-79aea97f6660 h1:5LFnUY/Aj/0k/UqeEmW2GS4ql1vxmivkrckPxUHf8oc= -github.com/beeper/discordgo v0.0.0-20230426184739-79aea97f6660/go.mod h1:59+AOzzjmL6onAh62nuLXmn7dJCaC/owDLWbGtjTcFA= +github.com/beeper/discordgo v0.0.0-20230512133900-5b12693331c0 h1:ECBEbC4ruaXzcVJJ4UurkGpT/Xlm9ZnwsHiHn9gjPZw= +github.com/beeper/discordgo v0.0.0-20230512133900-5b12693331c0/go.mod h1:59+AOzzjmL6onAh62nuLXmn7dJCaC/owDLWbGtjTcFA= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=