Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
InstagramEmbedder,
RedditEmbedder,
TikTokEmbedder,
TwitterEmbedder,
)
from modules.misobot import MisoBot

Expand Down Expand Up @@ -394,6 +395,12 @@ async def parse_media_auto_embed(
if posts:
await self.embed_posts(posts, message, embedder)

if media_settings["twitter"]:
embedder = TwitterEmbedder(self.bot)
posts = embedder.extract_links(message.content)
if posts:
await self.embed_posts(posts, message, embedder)

@staticmethod
async def easter_eggs(message: discord.Message):
"""Easter eggs handler"""
Expand Down
10 changes: 7 additions & 3 deletions cogs/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@ async def youtube(self, ctx: commands.Context, *, query):
).run(ctx)

@util.patrons_only()
@commands.group(usage="<instagram | tiktok | reddit>", case_insensitive=True)
@commands.group(
usage="<instagram | tiktok | reddit | twitter>", case_insensitive=True
)
async def autoembedder(
self, ctx: commands.Context, provider: Literal["instagram", "tiktok", "reddit"]
self,
ctx: commands.Context,
provider: Literal["instagram", "tiktok", "reddit", "twitter"],
):
"""Set up automatic embeds for various media sources

The links will be expanded automatically when detected in chat,
without requiring the use of the corresponding command.

Supported providers: `instagram`, `tiktok`, `reddit`
Supported providers: `instagram`, `tiktok`, `reddit`, 'twitter'

Example: >autoembedder tiktok toggle
"""
Expand Down
Loading