aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-28 18:44:26 +0300
committerGravatar ks129 <[email protected]>2020-04-28 18:44:26 +0300
commitd49516c3d4231569f2f2ec6bde84299ded6fc2f4 (patch)
tree4df7d4da65b88739707d865ddf87146e2a16eaa1
parentMinor terminology change on a log (diff)
Simplified New publishing check + removed unnecessary Webhook check
- Replaced type checking with `TextChannel.is_news()` for simplification to check is possible to publish new - Removed unnecessary `while` loop on `send_webhook` that check is webhook available. No need for this after starting ordering modification.
-rw-r--r--bot/cogs/news.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/bot/cogs/news.py b/bot/cogs/news.py
index d7b2bcabb..66645bca7 100644
--- a/bot/cogs/news.py
+++ b/bot/cogs/news.py
@@ -116,7 +116,7 @@ class News(Cog):
)
payload["data"]["pep"].append(msg.id)
- if msg.channel.type is discord.ChannelType.news:
+ if msg.channel.is_news():
log.trace("Publishing PEP annnouncement because it was in a news channel")
await msg.publish()
@@ -170,7 +170,7 @@ class News(Cog):
)
payload["data"][maillist].append(msg.id)
- if msg.channel.type is discord.ChannelType.news:
+ if msg.channel.is_news():
log.trace("Publishing mailing list message because it was in a news channel")
await msg.publish()
@@ -223,10 +223,6 @@ class News(Cog):
)
embed.set_footer(text=footer, icon_url=AVATAR_URL)
- # Wait until Webhook is available
- while not self.webhook:
- pass
-
return await self.webhook.send(
embed=embed,
username=webhook_profile_name,