How to use the pypresence.utils.remove_none function in pypresence

To help you get started, we’ve selected a few pypresence examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qwertyquerty / pypresence / pypresence / payloads.py View on Github external
def __init__(self, data, clear_none=True):
        if clear_none:
            data = remove_none(data)
        self.data = data
github qwertyquerty / pypresence / pypresence / activity.py View on Github external
def __setattr__(self, name, value):
        p = getattr(self, 'p_properties', None)
        r = getattr(self, 'response', None)
        if p and name in p:
            r.set_prop(name,value)

            payload = remove_none(self.response.to_dict())

            self.client.update(_donotuse=payload)
        else:
            self.__dict__[name] = value