curious.dataclasses.user

Wrappers for User objects.

Classes

AvatarUrl(user) Represents a user’s avatar URL.
BotUser(client, **kwargs) A special type of user that represents ourselves.
User(client, **kwargs) This represents a bare user - i.e, somebody without a guild attached.
class curious.dataclasses.user.AvatarUrl(user: curious.dataclasses.user.User) → None[source]

Bases: object

Represents a user’s avatar URL.

To get the actual URL, do str(avatar_url).

Parameters:user (User) – The User for this URL.
as_format(format)[source]

Gets the URL in the specified format.

Parameters:format (str) – The format to use. Usually png, webp or gif.
Return type:AvatarUrl
Returns:A new AvatarUrl with the specified format.
with_size(size)[source]

Gets the URL in the specified size.

Parameters:size (int) – The size for the URL.
Return type:AvatarUrl
Returns:A new AvatarUrl with the specified size.
class curious.dataclasses.user.BotUser(client, **kwargs)[source]

Bases: curious.dataclasses.user.User

A special type of user that represents ourselves.

Inspects the stack to ensure we’re being called correctly.

avatar_url
Return type:AvatarUrl
Returns:The avatar URL of this user.
created_at
Return type:datetime
Returns:The datetime.datetime this user was created at.
await edit(*args, **kwargs)[source]

Edits the bot’s current profile.

mention
Return type:str
Returns:A string that mentions this user.
snowflake_timestamp
Return type:datetime
Returns:The timestamp of the snowflake.
static_avatar_url
Return type:str
Returns:The avatar URL of this user, but static.
unban_from(guild)

Unbans this user from a guild.

Parameters:guild (Guild) – The Guild to unban in.
await upload_avatar(path)[source]

A higher level interface to editing the bot’s avatar.

class curious.dataclasses.user.User(client, **kwargs)[source]

Bases: curious.dataclasses.bases.Dataclass

This represents a bare user - i.e, somebody without a guild attached. This is used in DMs and similar. All member objects have a reference to their user on .user.

Variables:id – The ID of this user.

Inspects the stack to ensure we’re being called correctly.

avatar_url
Return type:AvatarUrl
Returns:The avatar URL of this user.
created_at
Return type:datetime
Returns:The datetime.datetime this user was created at.
mention
Return type:str
Returns:A string that mentions this user.
await open_private_channel()[source]

Opens a private channel with a user.

Note

You probably won’t need this to just send messages to a user.

Return type:Channel
Returns:The newly created private channel.
await send(content=None, *args, **kwargs)[source]

Sends a message to the user over a private channel.

Parameters:content (Optional[str]) – The contet of the message to send.
Return type:Message
Returns:A new Message representing the sent message.
snowflake_timestamp
Return type:datetime
Returns:The timestamp of the snowflake.
static_avatar_url
Return type:str
Returns:The avatar URL of this user, but static.
await unban_from(guild)[source]

Unbans this user from a guild.

Parameters:guild (Guild) – The Guild to unban in.