summary refs log tree commit diff homepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Config.ts2
-rw-r--r--src/Discord.ts9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Config.ts b/src/Config.ts
index 5a1417d..ee24698 100644
--- a/src/Config.ts
+++ b/src/Config.ts
@@ -37,6 +37,8 @@ export interface Config {
 
   SERVER_NAME: string
   SERVER_IMAGE: string
+  HEAD_IMAGE_URL: string
+  DEFAULT_PLAYER_HEAD: string
   SHOW_SERVER_STATUS: boolean
   SHOW_PLAYER_CONN_STAT: boolean
   SHOW_PLAYER_ADVANCEMENT: boolean
diff --git a/src/Discord.ts b/src/Discord.ts
index e1a7903..b001c8c 100644
--- a/src/Discord.ts
+++ b/src/Discord.ts
@@ -219,17 +219,22 @@ class Discord {
     }
   }
 
+  private getHeadUrl(uuid: string): string {
+    const url = this.config.HEAD_IMAGE_URL || 'https://minotar.net/helm/%uuid%/256.png'
+    return url.replace(/%uuid%/, uuid)
+  }
+
   private async makeDiscordWebhook (username: string, message: string) {
     message = this.replaceDiscordMentions(message)
 
-    const defaultHead = 'https://minotar.net/helm/c06f89064c8a49119c29ea1dbd1aab82/256.png' // MHF_Steve
+    const defaultHead = this.getHeadUrl(this.config.DEFAULT_PLAYER_HEAD || 'c06f89064c8a49119c29ea1dbd1aab82') // MHF_Steve
 
     let avatarURL
     if (username === this.config.SERVER_NAME + ' - Server') { // use avatar for the server
       avatarURL = this.config.SERVER_IMAGE || defaultHead
     } else { // use avatar for player
       const uuid = await this.getUUIDFromUsername(username)
-      avatarURL = !!uuid ? `https://minotar.net/helm/${uuid}/256.png` : defaultHead
+      avatarURL = !!uuid ? this.getHeadUrl(uuid) : defaultHead
     }
 
     return {
1f228f6fed3e4a2c324376caef1&follow=1'>Add Conversations With FriendsJune McEnroe 2022-07-30Add Normal PeopleJune McEnroe 2022-07-26Rewrite glitch from new pngoJune McEnroe 2022-07-26Update Care with time-to-ID and piercingsJune McEnroe 2022-07-26Add -w to upJune McEnroe 2022-07-13Set push.autoSetupRemoteJune McEnroe 2022-07-08Remove TOURJune McEnroe 2022-07-03Add The Bone Shard EmperorJune McEnroe 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe