Intern status and overwrite strings
This commit is contained in:
parent
ab049e3eb0
commit
27b224778b
@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
import sys
|
||||||
import copy
|
import copy
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
@ -169,7 +170,7 @@ class _Overwrites:
|
|||||||
self.id = kwargs.pop('id')
|
self.id = kwargs.pop('id')
|
||||||
self.allow = kwargs.pop('allow', 0)
|
self.allow = kwargs.pop('allow', 0)
|
||||||
self.deny = kwargs.pop('deny', 0)
|
self.deny = kwargs.pop('deny', 0)
|
||||||
self.type = kwargs.pop('type')
|
self.type = sys.intern(kwargs.pop('type'))
|
||||||
|
|
||||||
def _asdict(self):
|
def _asdict(self):
|
||||||
return {
|
return {
|
||||||
|
@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
import sys
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
|
|
||||||
import discord.abc
|
import discord.abc
|
||||||
@ -215,10 +216,10 @@ class Member(discord.abc.Messageable, _BaseUser):
|
|||||||
clone = cls(data=data, guild=guild, state=state)
|
clone = cls(data=data, guild=guild, state=state)
|
||||||
to_return = cls(data=data, guild=guild, state=state)
|
to_return = cls(data=data, guild=guild, state=state)
|
||||||
to_return._client_status = {
|
to_return._client_status = {
|
||||||
key: value
|
sys.intern(key): sys.intern(value)
|
||||||
for key, value in data.get('client_status', {}).items()
|
for key, value in data.get('client_status', {}).items()
|
||||||
}
|
}
|
||||||
to_return._client_status[None] = data['status']
|
to_return._client_status[None] = sys.intern(data['status'])
|
||||||
return to_return, clone
|
return to_return, clone
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -260,10 +261,10 @@ class Member(discord.abc.Messageable, _BaseUser):
|
|||||||
def _presence_update(self, data, user):
|
def _presence_update(self, data, user):
|
||||||
self.activities = tuple(map(create_activity, data.get('activities', [])))
|
self.activities = tuple(map(create_activity, data.get('activities', [])))
|
||||||
self._client_status = {
|
self._client_status = {
|
||||||
key: value
|
sys.intern(key): sys.intern(value)
|
||||||
for key, value in data.get('client_status', {}).items()
|
for key, value in data.get('client_status', {}).items()
|
||||||
}
|
}
|
||||||
self._client_status[None] = data['status']
|
self._client_status[None] = sys.intern(data['status'])
|
||||||
|
|
||||||
if len(user) > 1:
|
if len(user) > 1:
|
||||||
return self._update_inner_user(user)
|
return self._update_inner_user(user)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user