perf(shard): ⚡ Remove duplicate set_search() call in CallManager.hangup().

This commit is contained in:
2025-03-16 23:33:34 -03:00
parent af71718d59
commit b6c3da6963
3 changed files with 10 additions and 14 deletions
+1 -4
View File
@@ -126,10 +126,7 @@ class Payphone(commands.AutoShardedBot):
try: try:
return await self.fetch_channel(channel_id) return await self.fetch_channel(channel_id)
except discord.errors.NotFound: except (discord.errors.Forbidden, discord.errors.NotFound):
return None
except discord.errors.Forbidden:
return None return None
return channel return channel
+7 -7
View File
@@ -270,8 +270,8 @@ class Calls(base.Cog):
else: else:
return await message.channel.send( return await message.channel.send(
"💖 Stickers and GIFs are only allowed to donators! You can become one at [our Ko-Fi " "💖 Stickers and GIFs are only allowed to donators! You can become one at [our "
"page](<https://ko-fi.com/payphonedev>)." "Ko-Fi page](<https://ko-fi.com/payphonedev>)."
) )
if message.attachments: if message.attachments:
@@ -289,7 +289,6 @@ class Calls(base.Cog):
if not message_content: if not message_content:
return return
else:
has_sent_attachments = True has_sent_attachments = True
embeds = [] embeds = []
@@ -325,7 +324,8 @@ class Calls(base.Cog):
replied_message = None replied_message = None
await self.bot.get_partial_messageable(other_channel).send( await self.bot.get_partial_messageable(other_channel).send(
"❌ **Payphone** is missing permissions to read messages from this channel. Make sure it's got `Read Message History` permissions." "❌ **Payphone** is missing permissions to read messages from this "
"channel. Make sure it's got `Read Message History` permissions."
) )
if replied_message is not None: if replied_message is not None:
@@ -381,7 +381,7 @@ class Calls(base.Cog):
footer=random.choice( footer=random.choice(
[ [
discord.EmbedFooter( discord.EmbedFooter(
text="You can also become a supporter at our Ko-Fi page." text="Become a supporter at our Ko-Fi page!"
) )
] ]
+ [None] * 3 + [None] * 3
@@ -517,8 +517,8 @@ class Calls(base.Cog):
await self.bot.get_partial_messageable(payload.channel_id).send( await self.bot.get_partial_messageable(payload.channel_id).send(
( (
f"❌ **{payload.data["member"]["nick"] or payload.data["member"]["user"]["global_name"] or payload.data["member"]["user"]["username"]}** " f"❌ **{payload.data["member"]["nick"] or payload.data["member"]["user"]["global_name"] or payload.data["member"]["user"]["username"]}** "
f"your message wasn't sent because it contained a blocked message or " "your message wasn't sent because it contained a blocked message or "
"pattern: `{blocked_section}`\n-# Payphone doesn't have read message history " f"pattern: `{blocked_section}`\n-# Payphone doesn't have read message history "
"permission? Make sure to keep that one enabled." "permission? Make sure to keep that one enabled."
), ),
delete_after=10, delete_after=10,
-1
View File
@@ -482,7 +482,6 @@ class CallHandler:
if call_id is None: if call_id is None:
# Channel is searching. # Channel is searching.
await self.set_searching(channel_id, False)
return (channel_id,) return (channel_id,)
channels = [ channels = [