aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-07-08 23:18:13 -0400
committerRapptz <[email protected]>2020-07-08 23:28:37 -0400
commit10d1feb3efd699500f1adb4cee8d965518b0d061 (patch)
treee3c697813472f82e6ffb22ed6ad2e2477a996ccc
parentVersion bump to v1.3.3 (diff)
downloaddiscord.py-10d1feb3efd699500f1adb4cee8d965518b0d061.tar.xz
discord.py-10d1feb3efd699500f1adb4cee8d965518b0d061.zip
Don't use a namedtuple for _Overwrites
Fix #5109
-rw-r--r--discord/abc.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/discord/abc.py b/discord/abc.py
index 2a14c349..ef078031 100644
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -27,7 +27,6 @@ DEALINGS IN THE SOFTWARE.
import abc
import copy
import asyncio
-from collections import namedtuple
from .iterators import HistoryIterator
from .context_managers import Typing
@@ -162,7 +161,22 @@ class PrivateChannel(metaclass=abc.ABCMeta):
return NotImplemented
return NotImplemented
-_Overwrites = namedtuple('_Overwrites', 'id allow deny type')
+class _Overwrites:
+ __slots__ = ('id', 'allow', 'deny', 'type')
+
+ def __init__(self, **kwargs):
+ self.id = kwargs.pop('id')
+ self.allow = kwargs.pop('allow', 0)
+ self.deny = kwargs.pop('deny', 0)
+ self.type = kwargs.pop('type')
+
+ def _asdict(self):
+ return {
+ 'id': self.id,
+ 'allow': self.allow,
+ 'deny': self.deny,
+ 'type': self.type,
+ }
class GuildChannel:
"""An ABC that details the common operations on a Discord guild channel.