From 0a37f7ae8253941206348e5d148e7199a4dc244a Mon Sep 17 00:00:00 2001 From: Baviaan Date: Fri, 4 Dec 2020 01:33:51 +0000 Subject: [PATCH] meetup and train --- meowth/exts/raid/objects.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/meowth/exts/raid/objects.py b/meowth/exts/raid/objects.py index 06fd58831..a38a86a57 100644 --- a/meowth/exts/raid/objects.py +++ b/meowth/exts/raid/objects.py @@ -308,7 +308,13 @@ async def update_rsvp(self, user_id=None, status=None): display_status = 'has canceled' else: return - content = f"<@!{user_id}> {display_status}!" + guild = self.bot.get_guild(self.guild_id) + user = guild.get_member(user_id) + if user: + user_content = user.display_name + else: + user_content = f"<@!{user_id}>" + content = f"{user_content} {display_status}!" try: await chn.send(content, allowed_mentions=discord.AllowedMentions.none()) await chn.send(embed=rsvpembed, delete_after=15) @@ -3212,7 +3218,12 @@ async def update_rsvp(self, user_id, status): status_str = ' has joined the train!' elif status == 'cancel': status_str =' has left the train!' - content = f'<@!{user_id}>{status_str}' + user = guild.get_member(user_id) + if user: + user_content = user.display_name + else: + user_content = f"<@!{user_id}>" + content = f"{user_content} {status_str}!" embed = TRSVPEmbed.from_train(self).embed await channel.send(content, allowed_mentions=discord.AllowedMentions.none()) await channel.send(embed=embed, delete_after=15)