Skip to content

Commit

Permalink
Merge pull request #44 from coffeebank/hellohook/display-names
Browse files Browse the repository at this point in the history
 hellohook: Add global nickname and server nickname variables
  • Loading branch information
coffeebank authored Nov 12, 2024
2 parents fb3ca44 + 09217d7 commit d98281e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hellohook/hellohook.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ async def hellohookSender(self, webhook, userObj: discord.Member, greetMessage):
greetMessageStr = greetMessageStr.replace("https://&&USERMENTION&&", str(userObj.mention))
if "https://&&USERNAME&&" in greetMessageStr:
greetMessageStr = greetMessageStr.replace("https://&&USERNAME&&", str(userObj.name))
# 2024: Will return #0, new Discord username system: https://support.discord.com/hc/en-us/articles/12620128861463-New-Usernames-Display-Names
if "https://&&USERNAME1234&&" in greetMessageStr:
greetMessageStr = greetMessageStr.replace("https://&&USERNAME1234&&", str(userObj.name)+"#"+str(userObj.discriminator))
if "https://&&GLOBALNAME&&" in greetMessageStr:
greetMessageStr = greetMessageStr.replace("https://&&GLOBALNAME&&", str(userObj.global_name))
if "https://&&DISPLAYNAME&&" in greetMessageStr:
greetMessageStr = greetMessageStr.replace("https://&&DISPLAYNAME&&", str(userObj.display_name))
if "https://&&SERVERCOUNT&&" in greetMessageStr:
greetMessageStr = greetMessageStr.replace("https://&&SERVERCOUNT&&", str(userObj.guild.member_count))
if "https://&&SERVERCOUNTORD&&" in greetMessageStr:
Expand Down

0 comments on commit d98281e

Please sign in to comment.