Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.8k stars 3.75k forks source link

Exception when editing channel #5113

Closed TheVexedGerman closed 4 years ago

TheVexedGerman commented 4 years ago

Summary

Bot raises a TypeError exception when editing a channel.

Traceback (most recent call last):
  File "/home/jan/.local/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 73, in _loop
    await self.coro(*args, **kwargs)
  File "/home/jan/My-Reddit-Bot/cogs/discord_tools.py", line 215, in shitposting
    await self.bot.get_channel(channel).edit(name=name)
  File "/home/jan/.local/lib/python3.8/site-packages/discord/channel.py", line 683, in edit
    await self._edit(options, reason=reason)
  File "/home/jan/.local/lib/python3.8/site-packages/discord/abc.py", line 285, in _edit
    self._update(self.guild, data)
  File "/home/jan/.local/lib/python3.8/site-packages/discord/channel.py", line 584, in _update
    self._fill_overwrites(data)
  File "/home/jan/.local/lib/python3.8/site-packages/discord/abc.py", line 294, in _fill_overwrites
    self._overwrites.append(_Overwrites(id=overridden_id, **overridden))
  TypeError: __new__() got an unexpected keyword argument 'allow_new'

Reproduction Steps

Load the channel, attempt to edit the name.


CHANNEL_ID = XXX

    async def update_channel_name(self, ctx, name: str):
        "Update the channel name"
        await self.bot.get_channel(CHANNEL_ID).edit(name=name)
        return await ctx.send(f"I updated the channel name to {name} for you")

Expected Results

The channel name gets updated and the method finishes executing.

Actual Results

The channel name gets updated and an exception is raised which halts further execution of the method.

Checklist

System Information

- Python v3.8.0-final
- discord.py v1.3.3-final
- aiohttp v3.6.2
- websockets v8.1
- system info: Linux 4.15.0-106-generic #107-Ubuntu SMP Thu Jun 4 11:27:52 UTC 2020
Gobot1234 commented 4 years ago

Update to 1.3.4.

TheVexedGerman commented 4 years ago

Silly me. I looked at the changelog page and didn't see that there was a newer version, so I assumed there wasn't an update yet.

Thanks for the help.

Harmon758 commented 4 years ago

Duplicate of #5109