diff options
| author | 2020-05-13 14:17:51 +0300 | |
|---|---|---|
| committer | 2020-05-13 14:17:51 +0300 | |
| commit | d7e6bed7b5b0f61312165e5b0b2b9291cd8df0c9 (patch) | |
| tree | 94083bf84ae15e9d126820246fb314ba3e32dc17 | |
| parent | Merge pull request #875 from python-discord/bug/info/869/tag-encoding (diff) | |
Add message publishing to `Reddit` cog
Diffstat (limited to '')
| -rw-r--r-- | bot/cogs/reddit.py | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py index 5a7fa100f..371b65434 100644 --- a/bot/cogs/reddit.py +++ b/bot/cogs/reddit.py @@ -218,7 +218,10 @@ class Reddit(Cog):          for subreddit in RedditConfig.subreddits:              top_posts = await self.get_top_posts(subreddit=subreddit, time="day") -            await self.webhook.send(username=f"{subreddit} Top Daily Posts", embed=top_posts) +            message = await self.webhook.send(username=f"{subreddit} Top Daily Posts", embed=top_posts) + +            if message.channel.is_news(): +                await message.publish()      async def top_weekly_posts(self) -> None:          """Post a summary of the top posts.""" @@ -242,6 +245,9 @@ class Reddit(Cog):                  await message.pin() +                if message.channel.is_news(): +                    await message.publish() +      @group(name="reddit", invoke_without_command=True)      async def reddit_group(self, ctx: Context) -> None:          """View the top posts from various subreddits.""" | 
