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:
return await self.fetch_channel(channel_id)
except discord.errors.NotFound:
return None
except discord.errors.Forbidden:
except (discord.errors.Forbidden, discord.errors.NotFound):
return None
return channel
+8 -8
View File
@@ -270,8 +270,8 @@ class Calls(base.Cog):
else:
return await message.channel.send(
"💖 Stickers and GIFs are only allowed to donators! You can become one at [our Ko-Fi "
"page](<https://ko-fi.com/payphonedev>)."
"💖 Stickers and GIFs are only allowed to donators! You can become one at [our "
"Ko-Fi page](<https://ko-fi.com/payphonedev>)."
)
if message.attachments:
@@ -289,8 +289,7 @@ class Calls(base.Cog):
if not message_content:
return
else:
has_sent_attachments = True
has_sent_attachments = True
embeds = []
@@ -325,7 +324,8 @@ class Calls(base.Cog):
replied_message = None
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:
@@ -381,7 +381,7 @@ class Calls(base.Cog):
footer=random.choice(
[
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
@@ -517,8 +517,8 @@ class Calls(base.Cog):
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"your message wasn't sent because it contained a blocked message or "
"pattern: `{blocked_section}`\n-# Payphone doesn't have read message history "
"your message wasn't sent because it contained a blocked message or "
f"pattern: `{blocked_section}`\n-# Payphone doesn't have read message history "
"permission? Make sure to keep that one enabled."
),
delete_after=10,
-1
View File
@@ -482,7 +482,6 @@ class CallHandler:
if call_id is None:
# Channel is searching.
await self.set_searching(channel_id, False)
return (channel_id,)
channels = [