Skip to content

Commit

Permalink
Add notice of instagram breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Aug 30, 2023
1 parent 65fa9a6 commit 9a03f05
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ async def on_message(self, message: discord.Message):

media_settings = self.bot.cache.media_auto_embed.get(str(message.guild.id), {})
if True in media_settings.values():
await self.parse_media_auto_embed(message, media_settings)
try:
await self.parse_media_auto_embed(message, media_settings)
except Exception as e:
await self.bot.get_cog("ErrorHandler").on_command_error(ctx, e)

if self.bot.cache.autoresponse.get(str(message.guild.id), True):
await self.easter_eggs(message)
Expand Down
5 changes: 5 additions & 0 deletions modules/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import redis
from loguru import logger

from modules import exceptions

if TYPE_CHECKING:
from modules.misobot import MisoBot

Expand Down Expand Up @@ -144,6 +146,9 @@ async def save_cache(self, cache_key: str, data: dict, lifetime: int):
logger.warning("Could not save content into redis cache (ConnectionError)")

async def api_request(self, endpoint: str, params: dict) -> dict:
raise exceptions.CommandWarning(
"The Instagram scraper was taken down by Meta Inc :("
)
headers = {
"accept": "application/json",
"x-access-key": self.bot.keychain.DATALAMA_ACCESS_KEY,
Expand Down
2 changes: 1 addition & 1 deletion modules/media_embedders.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ async def create_message(
"content": caption,
"files": files,
"view": MediaUI(
"View on X", f"https://x.com/{screen_name}/status/{tweet_id}"
"View on X", f"https://twitter.com/{screen_name}/status/{tweet_id}"
),
}

Expand Down

0 comments on commit 9a03f05

Please sign in to comment.