Skip to content

Commit

Permalink
[InviteBlockList] 1.1.4 Stop fetching edited messages
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Dec 21, 2023
1 parent fcada85 commit b02d2b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TrustyJAID's Cogs for [Red-DiscordBot](https://github.com/Cog-Creators/Red-Disc
| Imagemaker | 1.6.0 | <details><summary>Create your own feels!</summary>Show how you really feel. Make someone beautiful. Make something illegal.</details> | TrustyJAID, Ivan Seidel (isnowillegal.com), Bruno Lemos (isnowillegal.com), and João Pedro (isnowillegal.com) |
| Imgflip | 3.0.0 | <details><summary>Recreation of Red v1 meme generator</summary>Recreation of Red v1 meme generator</details> | Twentysix and TrustyJAID |
| Insult | 1.0.0 | <details><summary>Insult people in a creative way</summary>Insult people in a creative way ![goteem](https://cdn.discordapp.com/emojis/350653489044652052.png?v=1)</details> | Airen, JennJenn, and TrustyJAID |
| InviteBlocklist | 1.1.3 | <details><summary>Block or Allow invite links based on guild ID. Accepts invite links to extract guild ID's.</summary>Automatically delete discord invite links from specific guilds or allow only specified guild invites to be posted.</details> | TrustyJAID |
| InviteBlocklist | 1.1.4 | <details><summary>Block or Allow invite links based on guild ID. Accepts invite links to extract guild ID's.</summary>Automatically delete discord invite links from specific guilds or allow only specified guild invites to be posted.</details> | TrustyJAID |
| MentionPrefix | 1.1.0 | <details><summary>This cog allows ping the bot to see the prefixes available.</summary>This cog allows ping the bot to see the prefixes available.</details> | Draper and TrustyJAID |
| Mock | 1.1.0 | <details><summary>Mock another user!</summary>Mock another user! If you need the core dev commands start the bot without the `--dev` flag and install the loaddev cog in my repo that allows you to replace `mock` with whatever you choose.</details> | TrustyJAID |
| NASA | 1.0.0 | <details><summary>Cog for getting info from NASA's API</summary>Get information from NASA's API</details> | TrustyJAID |
Expand Down
15 changes: 9 additions & 6 deletions inviteblocklist/inviteblocklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def convert(

class InviteBlocklist(commands.Cog):
__author__ = ["TrustyJAID"]
__version__ = "1.1.3"
__version__ = "1.1.4"

def __init__(self, bot):
self.bot = bot
Expand Down Expand Up @@ -127,11 +127,14 @@ async def on_raw_message_edit(self, payload: discord.RawMessageUpdateEvent):
or guild_settings["whitelist"]
or guild_settings["all_invites"]
):
try:
msg = await chan.fetch_message(payload.message_id)
except (discord.errors.Forbidden, discord.errors.NotFound):
return
await self._handle_message_search(msg)
if payload.cached_message is not None:
await self._handle_message_search(payload.cached_message)
else:
msg = discord.Message(state=chan._state, channel=chan, data=payload.data)
# construct the message object regardless of cache state
# d.py will normally ignore these edits and not build the full object
# so we manually construct it here for simplicity
await self._handle_message_search(msg)

async def check_immunity_list(self, message: discord.Message) -> bool:
is_immune = False
Expand Down

0 comments on commit b02d2b0

Please sign in to comment.