Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AvatarUrl changes #1668

Merged
merged 6 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions src/main/java/github/scarsz/discordsrv/DiscordSRV.java
Original file line number Diff line number Diff line change
Expand Up @@ -2090,20 +2090,17 @@ private static String constructAvatarUrl(String username, UUID uuid, String text
avatarUrl = !offline ? defaultUrl : offlineUrl;
}

if (offline && !avatarUrl.contains("{username}")) {
boolean defaultValue = avatarUrl.equals(defaultUrl);
if (defaultValue) {
// Using default value while in offline mode -> use offline url
avatarUrl = offlineUrl;
}
if (avatarUrl.contains("://crafatar.com/")) {
avatarUrl = !offline ? defaultUrl : offlineUrl;
DiscordSRV.config().setRuntimeValue("AvatarUrl", avatarUrl);

if (!offlineUuidAvatarUrlNagged) {
DiscordSRV.error("Your AvatarUrl config option does not contain the {username} placeholder even though this server is using offline UUIDs.");
DiscordSRV.error(offlineUrl + " will be used because the default value does not support offline mode servers");
DiscordSRV.error("You should set your AvatarUrl (in config.yml) to " + offlineUrl + " (or another url that supports usernames) "
+ (defaultValue ? "to get rid of this error" : "to get avatars to work."));
offlineUuidAvatarUrlNagged = true;
}
DiscordSRV.error("Your AvatarUrl config option uses crafatar.com which no longer supports Discord so an alternative provider will be used.");
Scarsz marked this conversation as resolved.
Show resolved Hide resolved
DiscordSRV.error("You should set your AvatarUrl (in config.yml) to an empty string (\"\") to get rid of this error.");
}

if (offline && !avatarUrl.contains("{username}") && !offlineUuidAvatarUrlNagged) {
DiscordSRV.error("Your AvatarUrl config option does not contain the {username} placeholder even though this server is using offline UUIDs.");
offlineUuidAvatarUrlNagged = true;
}

if (username.startsWith("*")) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Embed & webhook billede/avatar url format
# Alternativ integreret avatar-url til offlineservere:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Lad stå tomt for at bruge en standardværdi
# Tilgængelige pladsholdere: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Konverterer formatering (fed, kursiv, understregning, gennemstregning) mellem Minecraft og Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Einbetten und Webhook-Bild-/Avatar-URL-Format
# Alternative Einbettungs-Avatar-URL für Offline-Server:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Lassen Sie das Feld leer, um einen Standardwert zu verwenden
# Verfügbare Platzhalter: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Konvertiert die Formatierung (fett, kursiv, unterstreicht) zwischen Minecraft und Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Embed & webhook image/avatar url format
# Alternative embed avatar url for offline servers:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Leave blank to use a default value
# Available placeholders: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Converts formatting (bold, italics, underline, strikethrough) between Minecraft and Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Formato de URL de avatar/imagen para insertar y webhook
# URL de avatar incrustada alternativa para servidores fuera de línea:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Dejar en blanco para usar un valor predeterminado
# Marcadores de posición disponibles: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Convierte el formato (negrita, cursiva, subrayado) entre Minecraft y Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Embed & webhook image/avatar url format
# Alternative embed avatar url for offline servers:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Vaikeväärtuse kasutamiseks jätke tühjaks
# Saadaolevad kohahoidjad: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Converts formatting (bold, italics, underline, strikethrough) between Minecraft and Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Format d'URL d'image/avatar d'intégration et de webhook
# URL d'avatar d'intégration alternative pour les serveurs hors ligne:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Laisser vide pour utiliser une valeur par défaut
# Espaces réservés disponibles: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Convertit le formatage (gras, italique, souligné) entre Minecraft et Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# 埋め込みと Webhook の画像/アバター URLの形式
# オフラインサーバー用の代替埋め込みアバターURL:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# デフォルト値を使用する場合は空白のままにします
# 利用可能なプレースホルダー: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# 書式の再変換
# MinecraftとDiscord間の書式設定(太字、斜体、下線、取り消し線)を変換する
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# 임베드 및 웹훅 이미지/아바타 URL 형식
# 오프라인 서버용 대체 아바타 URL 포함:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# 기본값을 사용하려면 비워 두세요.
# 사용 가능한 자리 표시자: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# 예를 들어 서식을 변환합니다. 굵은 기울임 꼴, 마인 크래프트와 Discord 사이에 밑줄
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Insluiten & webhook afbeelding/avatar url-formaat
# Alternatieve ingesloten avatar-url voor offline servers:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Laat dit leeg om een standaardwaarde te gebruiken
# Beschikbare tijdelijke aanduidingen: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Converteert opmaak (vetgedrukt, cursief, onderstreept) tussen Minecraft en Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Osadzanie i formatowanie adresu URL obrazu/awataru w webhooku
# Alternatywny adres URL wbudowanego awatara dla serwerów offline:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Pozostaw puste, aby użyć wartości domyślnej
# Dostępne symbole zastępcze: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Konwertuje formatowanie (pogrubienie, kursywa, podkreślenie, przekreślenie) między Minecraft i Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Встраивание и формат URL-адреса изображения / аватара веб-перехватчика
# Альтернативный URL-адрес для встраивания аватара для офлайн-серверов:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Оставьте пустым, чтобы использовать значение по умолчанию
# Доступные заполнители: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Преобразует форматирование (жирный, курсив, подчеркивание) между Minecraft и Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# Вбудовування та формат URL-адреси зображення / аватара веб-перехоплювача
# Альтернативна URL-адреса для вбудовування аватара для офлайн-серверів:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# Залиште поле порожнім, щоб використовувати значення за умовчанням
# Доступні заповнювачі: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# Перетворює форматування (жирний, курсив, підкреслення) між Minecraft та Discord
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

# 嵌入和 webhook 图像/头像 url 格式
# 离线服务器的替代嵌入头像网址:
# https://cravatar.eu/helmavatar/{username}/{size}.png#{texture}
AvatarUrl: https://crafthead.net/helm/{uuid-nodashes}/{size}#{texture}
# 留空以使用默认值
# 可用占位符: {texture} {username} {uuid} {uuid-nodashes} {size}
AvatarUrl: ""

# Reserializer
# 转换格式,例如 Minecraft和Discord之间的粗体,斜体,下划线
Expand Down
Loading