Skip to content

Commit

Permalink
fix text friendlifier
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Sep 24, 2024
1 parent ad77a00 commit 8fd11c5
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions revolt_bridge_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,9 @@ async def make_friendly(self, text):
while offset < len(components):
if len(components) == 1 and offset == 0:
break
userid = components[offset].split('>', 1)[0]
try:
userid = int(components[offset].split('>', 1)[0])
except:
userid = components[offset].split('>', 1)[0]
try:
user = self.bot.revolt_client.get_user(userid)
user = self.bot.get_user(userid)
display_name = user.display_name
except:
offset += 1
Expand All @@ -192,15 +189,12 @@ async def make_friendly(self, text):
while offset < len(components):
if len(components) == 1 and offset == 0:
break
try:
channelid = int(components[offset].split('>', 1)[0])
except:
channelid = components[offset].split('>', 1)[0]
channelid = components[offset].split('>', 1)[0]
try:
try:
channel = self.bot.revolt_client.get_channel(channelid)
channel = self.bot.get_channel(channelid)
except:
channel = await self.bot.revolt_client.fetch_channel(channelid)
channel = await self.bot.fetch_channel(channelid)
if not channel:
raise ValueError()
except:
Expand Down

0 comments on commit 8fd11c5

Please sign in to comment.