mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
Expose _ActivityTag as BaseActivity to easily refer to.
This commit is contained in:
@ -45,7 +45,7 @@ from .member import Member
|
||||
from .errors import *
|
||||
from .enums import Status, VoiceRegion
|
||||
from .gateway import *
|
||||
from .activity import _ActivityTag, create_activity
|
||||
from .activity import BaseActivity, create_activity
|
||||
from .voice_client import VoiceClient
|
||||
from .http import HTTPClient
|
||||
from .state import ConnectionState
|
||||
@ -147,7 +147,7 @@ class Client:
|
||||
must be used to fetch the offline members of the guild.
|
||||
status: Optional[:class:`.Status`]
|
||||
A status to start your presence with upon logging on to Discord.
|
||||
activity: Optional[Union[:class:`.Activity`, :class:`.Game`, :class:`.Streaming`]]
|
||||
activity: Optional[:class:`BaseActivity`]
|
||||
An activity to start your presence with upon logging on to Discord.
|
||||
heartbeat_timeout: :class:`float`
|
||||
The maximum numbers of seconds before timing out and restarting the
|
||||
@ -647,7 +647,7 @@ class Client:
|
||||
|
||||
@property
|
||||
def activity(self):
|
||||
"""Optional[Union[:class:`.Activity`, :class:`.Game`, :class:`.Streaming`]]: The activity being used upon
|
||||
"""Optional[:class:`BaseActivity`]: The activity being used upon
|
||||
logging in.
|
||||
"""
|
||||
return create_activity(self._connection._activity)
|
||||
@ -656,10 +656,10 @@ class Client:
|
||||
def activity(self, value):
|
||||
if value is None:
|
||||
self._connection._activity = None
|
||||
elif isinstance(value, _ActivityTag):
|
||||
elif isinstance(value, BaseActivity):
|
||||
self._connection._activity = value.to_dict()
|
||||
else:
|
||||
raise TypeError('activity must be one of Game, Streaming, or Activity.')
|
||||
raise TypeError('activity must derive from BaseActivity.')
|
||||
|
||||
# helpers/getters
|
||||
|
||||
@ -918,7 +918,7 @@ class Client:
|
||||
|
||||
Parameters
|
||||
----------
|
||||
activity: Optional[Union[:class:`.Game`, :class:`.Streaming`, :class:`.Activity`]]
|
||||
activity: Optional[:class:`BaseActivity`]
|
||||
The activity being done. ``None`` if no currently active activity is done.
|
||||
status: Optional[:class:`.Status`]
|
||||
Indicates what status to change to. If ``None``, then
|
||||
|
Reference in New Issue
Block a user