pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Unknown Overwrite Issue

Open rohitp30 opened this issue 5 years ago • 3 comments

Summary

Unable to Create Overwrites for a TextChannel

Reproduction Steps

Executing this via a task loop and simply trying to change a channels overwrites causes this issue.

Minimal Reproducible Code

@tasks.loop(minutes=1.0)
async def TicketInactive(self):
    TicketInfoTB = database.TicketInfo
    for entry in TicketInfoTB:
        channel: discord.TextChannel = await self.bot.fetch_channel(
            entry.ChannelID
        )

        overwrite = discord.PermissionOverwrite()
        overwrite.read_messages = False
        print(channel, overwrite)
        await channel.set_permissions(
             TicketOwner, overwrite=overwrite, reason="Ticket Closed"
        )

Expected Results

To remove TicketOwner's access from the channel via the overwrite.read_messages = False overwrite.

Actual Results

Unhandled exception in internal background task 'TicketInactive'.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/ext/tasks/__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "/Users/space/Documents/GitHub/Timmy-SchoolSimplified/utils/events/TicketDropdown.py", line 863, in TicketInactive
    await channel.set_permissions(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/abc.py", line 803, in set_permissions
    await http.edit_channel_permissions(self.id, target.id, allow.value, deny.value, perm_type, reason=reason)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/http.py", line 332, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10009): Unknown Overwrite

Intents

discord.Intents.all()

System Information

  • Python v3.9.1-final
  • py-cord v2.0.0-alpha
    • py-cord pkg_resources: v2.0.0a4293+g416f97c
  • aiohttp v3.6.2
  • system info: Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

Additional Context

No response

rohitp30 avatar Nov 12 '21 22:11 rohitp30

channel and overwrite are valid. Output of each:

other-social-studies-276, <discord.permissions.PermissionOverwrite object at 0x7fac1384df10>

rohitp30 avatar Nov 12 '21 22:11 rohitp30

Does this happen consistently?

middledot avatar Mar 30 '22 23:03 middledot

Can't reproduce this, closing (feel free to reopen if it persists)

Dorukyum avatar Apr 09 '22 18:04 Dorukyum