diff --git a/cogs/media.py b/cogs/media.py index 7a40d2e..a59f01f 100644 --- a/cogs/media.py +++ b/cogs/media.py @@ -201,7 +201,7 @@ async def instagram(self, ctx: commands.Context, *, links: str): await InstagramEmbedder(self.bot).process(ctx, links) @commands.command( - aliases=["twt"], + aliases=["twt", "x"], usage="[OPTIONS] ", ) async def twitter(self, ctx: commands.Context, *, links: str): diff --git a/modules/media_embedders.py b/modules/media_embedders.py index ffd8073..5dbde71 100644 --- a/modules/media_embedders.py +++ b/modules/media_embedders.py @@ -344,8 +344,8 @@ async def create_message( class TwitterEmbedder(BaseEmbedder): - EMOJI = "<:twitter:937425165241946162>" - NO_RESULTS_ERROR = "Found no Twitter links to embed!" + EMOJI = "<:x_:1135484782642466897>" + NO_RESULTS_ERROR = "Found no Twitter/X links to embed!" @staticmethod def remove_tco(text: str) -> str: @@ -369,7 +369,7 @@ def extract_links(text: str, include_id_only=True): results = [ int(match.group(2)) for match in regex.finditer( - r"(?:https?:\/\/)?(?:www.)?twitter.com/(\w+)/status/(\d+)", text + r"(?:https?:\/\/)?(?:www.)?(?:twitter|x).com/(\w+)/status/(\d+)", text ) ] @@ -447,7 +447,9 @@ async def create_message( return { "content": caption, "files": files, - "view": MediaUI("View on Twitter", tweet["tweetURL"]), + "view": MediaUI( + "View on X", f"https://x.com/{screen_name}/status/{tweet_id}" + ), }