API Reference¶
The following section outlines the API of guilded.py.
Note
This module uses the Python logging module to log diagnostic and errors in an output independent way. If the logging module is not configured, these logs will not be output anywhere. See Setting Up Logging for more information on how to set up and use the logging module.
Clients¶
Client¶
- class guilded.Client(*, internal_server_id=None, max_messages=..., features=None, **options)¶
The basic client class for interfacing with Guilded.
- Parameters
internal_server_id (Optional[
str
]) – The ID of the bot’s internal server.max_messages (Optional[
int
]) – The maximum number of messages to store in the internal message cache. This defaults to1000
. Passing inNone
disables the message cache.features (Optional[
ClientFeatures
]) – Client features to opt in or out of.
- loop¶
The event loop that the client uses for HTTP requests and websocket operations.
- ws¶
The websocket gateway the client is currently connected to. Could be
None
.- Type
Optional[
GuildedWebsocket
]
- max_messages¶
The maximum number of messages to store in the internal message cache. This defaults to
1000
. Passing inNone
disables the message cache.- Type
Optional[
int
]
- features¶
The features that are enabled or disabled for the client.
- Type
- property user¶
The in-Guilded user data of the client.
None
if not logged in.- Type
Optional[
ClientUser
]
- property cached_messages¶
The list of cached messages that the client has seen recently.
- Type
List[
ChatMessage
]
- property users¶
The list of users that the client can see. A user is not the same as a member, which is a server-specific representation. To get all members, use
get_all_members()
.- Type
List[
User
]
- property dm_channels¶
The private/DM channels that the client can see.
- Type
List[
DMChannel
]
- property private_channels¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
dm_channels
.The private/DM channels that the client can see.
- Type
List[
DMChannel
]
- property guilds¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
servers
.The list of servers that the client can see.
- Type
List[
Server
]
- for ... in get_all_channels()¶
A generator that retrieves every
ServerChannel
the client can see.This is equivalent to:
for server in client.servers: for channel in server.channels: yield channel
- Yields
ServerChannel
– A channel the client can see.
- for ... in get_all_members()¶
Returns a generator yielding every
Member
that the client can see.This is equivalent to:
for server in client.servers: for member in server.members: yield member
- Yields
Member
– A member the client can see.
- await wait_until_ready()¶
This function is a coroutine.
Waits until the client’s internal cache is all ready.
- await setup_hook()¶
This function is a coroutine.
A coroutine to be called to setup the bot, by default this is blank. To perform asynchronous setup after the bot is logged in but before it has connected to the Websocket, overwrite this method.
This is only called once, in
login()
, and will be called before any events are dispatched, making it a better solution than doing such setup in theon_ready()
event.Warning
Since this is called before the websocket connection is made therefore anything that waits for the websocket will deadlock, this includes things like
wait_for()
andwait_until_ready()
.
- wait_for(event, *, check=None, timeout=None)¶
This function is a coroutine.
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The
timeout
parameter is passed ontoasyncio.wait_for()
. By default, it does not timeout. Note that this does propagate theasyncio.TimeoutError
for you in case of timeout and is provided for ease of use.In case the event returns multiple arguments, a
tuple
containing those arguments is returned instead. Please check the documentation for a list of events and their parameters.This function returns the first event that meets the requirements.
Examples
Waiting for a user reply:
@client.event async def on_message(message): if message.content.startswith('$greet'): channel = message.channel await channel.send('Say hello!') def check(m): return m.content == 'hello' and m.channel == channel msg = await client.wait_for('message', check=check) await channel.send(f'Hello {msg.author}!')
Waiting for a thumbs up reaction from the message author:
@client.event async def on_message(message): if message.content.startswith('$thumb'): channel = message.channel await channel.send('Send me that 👍 reaction, mate') def check(reaction): return reaction.user == message.author and reaction.emote.id == 90001164 # https://gist.github.com/shayypy/8e492ad2d8801bfd38415986f68a547e try: reaction = await client.wait_for('message_reaction_add', timeout=60.0, check=check) except asyncio.TimeoutError: await channel.send('👎') else: await channel.send('👍')
- Parameters
event (
str
) – The event name, similar to the event reference, but without theon_
prefix, to wait for.check (Optional[Callable[…,
bool
]]) – A predicate to check what to wait for. The arguments must meet the parameters of the event being waited for.timeout (Optional[
float
]) – The number of seconds to wait before timing out and raisingasyncio.TimeoutError
.
- Raises
asyncio.TimeoutError – If a timeout is provided and it was reached.
- Returns
Returns no arguments, a single argument, or a
tuple
of multiple arguments that mirrors the parameters passed in the event reference.- Return type
Any
- event(coro)¶
A decorator to register an event for the library to automatically dispatch when appropriate.
You can find more info about the events on the documentation below.
The events must be a coroutine, if not,
TypeError
is raised.Example
@client.event async def on_ready(): print('Ready!')
- Raises
TypeError – The function passed is not actually a coroutine.
- get_partial_messageable(id, *, server_id=None, group_id=None, type=None, guild_id=None)¶
Returns a partial messageable with the given channel ID.
This is useful if you have a channel ID but don’t want to do an API call to send messages to it.
New in version 1.4.
- Parameters
id (
str
) – The channel ID to create a partial messageable for.server_id (Optional[
str
]) – The server ID that the channel is in. This is not required to send messages, but it is necessary for thejump_url
andserver
properties to work properly.group_id (Optional[
str
]) – The group ID that the channel is in. This is not required to send messages, but when combined withserver_id
, it helps thejump_url
property to render properly in the client, and it allows thegroup
property to work properly.type (Optional[
ChannelType
]) – The underlying channel type for the partial messageable. This does not have to be a messageable type, but Guilded will reject the request if you attempt to send to a non-messageable channel.
- Returns
The partial messageable that was created.
- Return type
- Raises
ValueError – Cannot provide both
server_id
andguild_id
- get_message(message_id, /)¶
Optional[
ChatMessage
]: Get a message from yourcached_messages
.As messages frequently enter and exit cache, you generally should not rely on this method. Instead, use
abc.Messageable.fetch_message()
.
- get_channel(channel_id, /)¶
Optional[
ServerChannel
]: Get a server channel or DM channel from your channels.
- await fetch_user(user_id, /)¶
This function is a coroutine.
Fetch a user from the API.
- Returns
The user from the ID.
- Return type
- await getch_user(user_id, /)¶
This function is a coroutine.
Try to get a user from internal cache, and if not found, try to fetch from the API.
- Returns
The user from the ID.
- Return type
- await fetch_public_server(server_id, /)¶
This function is a coroutine.
Fetch a public server from the API.
The client does not need to be a member of the server to use this method, but the server must have “Discoverable” enabled in its privacy settings.
This method will be limiting for you if you are a member of the server and are permitted to see non-public information. If this is the case, use
fetch_server()
instead.
- await fetch_server(server_id, /)¶
This function is a coroutine.
Fetch a server from the API.
- Returns
The server from the ID.
- Return type
- await getch_server(server_id, /)¶
This function is a coroutine.
Try to get a server from internal cache, and if not found, try to fetch from the API.
- Returns
The server from the ID.
- Return type
- await fetch_servers()¶
This function is a coroutine.
Fetch your list of servers from the API.
New in version 1.8.
- Returns
The servers you are a member of.
- Return type
List[
Server
]
- await fetch_channel(channel_id)¶
This function is a coroutine.
Fetch a channel from the API.
- Returns
The channel from the ID.
- Return type
- await getch_channel(channel_id)¶
This function is a coroutine.
Try to get a channel from internal cache, and if not found, try to fetch from the API.
- Returns
The channel from the ID.
- Return type
- await fetch_invite(invite_id)¶
This function is a coroutine.
Fetch an invite from the API.
Note
This method does not support vanity invites or full URLs.
- Returns
The invite from the ID.
- Return type
- await set_status(emote, *, content=...)¶
This function is a coroutine.
Update your custom status.
This method cannot be used to remove your status. Instead, use
remove_status()
.
- run(token, *, reconnect=True)¶
Connect to Guilded’s gateway and start the event loop. This is a blocking call; nothing after it will be called until the bot has been closed.
Event Reference¶
This section outlines the different types of events listened by Client
.
If an event handler raises an exception, on_error()
will be called
to handle it, which defaults to print a traceback and ignoring the exception.
You may be interested in the opt-in event style experiment,
which is available post-version 1.3.0. If you have this experiment enabled,
event handlers that correspond to real gateway messages will receive an
instance of a BaseEvent
subclass as their single parameter.
This is denoted below with notes linking back to this section.
Warning
Event functions must be a coroutine.
Announcements¶
- guilded.on_announcement_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A announcement was created in an announcement channel.
- Parameters
event (
AnnouncementCreateEvent
) – The event containing the payload.
- guilded.on_announcement_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A announcement was updated in an announcement channel.
- Parameters
event (
AnnouncementUpdateEvent
) – The event containing the payload.
- guilded.on_announcement_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A announcement was deleted in an announcement channel.
- Parameters
event (
AnnouncementDeleteEvent
) – The event containing the payload.
- guilded.on_announcement_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to an announcement.
- Parameters
event (
AnnouncementReactionAddEvent
) – The event containing the payload.
- guilded.on_announcement_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from an announcement.
- Parameters
event (
AnnouncementReactionRemoveEvent
) – The event containing the payload.
- guilded.on_announcement_reply_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reply was created under an announcement.
- Parameters
event (
AnnouncementReplyCreateEvent
) – The event containing the payload.
- guilded.on_announcement_reply_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A announcement reply was updated.
- Parameters
event (
AnnouncementReplyUpdateEvent
) – The event containing the payload.
- guilded.on_announcement_reply_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A announcement reply was deleted.
- Parameters
event (
AnnouncementReplyDeleteEvent
) – The event containing the payload.
- guilded.on_announcement_reply_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a reply under an announcement.
- Parameters
event (
AnnouncementReplyReactionAddEvent
) – The event containing the payload.
- guilded.on_announcement_reply_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a reply under an announcement.
- Parameters
event (
AnnouncementReplyReactionRemoveEvent
) – The event containing the payload.
Bots¶
- guilded.on_bot_add(server, member)¶
The client user was added to a server.
If you are using the event style experiment, this event takes a single parameter:
BotAddEvent
- guilded.on_bot_remove(server, member)¶
The client user was removed from a server.
If you are using the event style experiment, this event takes a single parameter:
BotRemoveEvent
Calendar Events¶
- guilded.on_calendar_event_create(event)¶
A calendar event was created in a calendar channel.
If you are using the event style experiment, this event takes a single parameter:
CalendarEventCreateEvent
- Parameters
event (
CalendarEvent
) – The event that was created.
- guilded.on_calendar_event_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A calendar event was updated in a calendar channel.
- Parameters
event (
CalendarEventUpdateEvent
) – The event containing the payload.
- guilded.on_raw_calendar_event_update(event)¶
If the event style experiment is enabled, this event will never be dispatched.
A calendar event was updated in a calendar channel.
- Parameters
event (
CalendarEvent
) – The event that was updated.
- guilded.on_calendar_event_delete(event)¶
A calendar event was deleted in a calendar channel.
If you are using the event style experiment, this event takes a single parameter:
CalendarEventDeleteEvent
- Parameters
event (
CalendarEvent
) – The event that was deleted.
- guilded.on_calendar_event_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a calendar event.
- Parameters
event (
CalendarEventReactionAddEvent
) – The event containing the payload.
- guilded.on_calendar_event_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a calendar event.
- Parameters
event (
CalendarEventReactionRemoveEvent
) – The event containing the payload.
- guilded.on_calendar_event_reply_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reply was created under a calendar event.
- Parameters
event (
CalendarEventReplyCreateEvent
) – The event containing the payload.
- guilded.on_calendar_event_reply_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A calendar event reply was updated.
- Parameters
event (
CalendarEventReplyUpdateEvent
) – The event containing the payload.
- guilded.on_calendar_event_reply_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A calendar event reply was deleted.
- Parameters
event (
CalendarEventReplyDeleteEvent
) – The event containing the payload.
- guilded.on_calendar_event_reply_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a reply under a calendar event.
- Parameters
event (
CalendarEventReplyReactionAddEvent
) – The event containing the payload.
- guilded.on_calendar_event_reply_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a reply under a calendar event.
- Parameters
event (
CalendarEventReplyReactionRemoveEvent
) – The event containing the payload.
- guilded.on_rsvp_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
An RSVP to a calendar event was created or deleted.
- Parameters
event (
RsvpUpdateEvent
) – The event containing the payload.
- guilded.on_raw_calendar_event_rsvp_update(event)¶
If the event style experiment is enabled, this event will never be dispatched.
An RSVP to a calendar event was created or deleted.
- Parameters
rsvp (
CalendarEventRSVP
) – The RSVP that was created or updated.
- guilded.on_bulk_rsvp_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
One or multiple RSVPs to a calendar event were created in bulk.
- Parameters
event (
BulkRsvpCreateEvent
) – The event containing the payload.
- guilded.on_bulk_calendar_event_rsvp_create(rsvps)¶
If the event style experiment is enabled, this event will never be dispatched.
One or multiple RSVPs to a calendar event were created in bulk.
- Parameters
rsvps (List[
CalendarEventRSVP
]) – The RSVPs that were created.
- guilded.on_rsvp_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
An RSVP to a calendar event was deleted.
- Parameters
event (
RsvpDeleteEvent
) – The event containing the payload.
- guilded.on_calendar_event_rsvp_delete(event)¶
If the event style experiment is enabled, this event will never be dispatched.
An RSVP to a calendar event was deleted.
- Parameters
rsvp (
CalendarEventRSVP
) – The rsvp that was deleted.
Channels¶
- guilded.on_category_create(category)¶
A channel category was created in a server.
If you are using the event style experiment, this event takes a single parameter:
CategoryCreateEvent
- Parameters
category (
Category
) – The category that was created.
- guilded.on_category_update(before, after)¶
A channel category was updated.
If you are using the event style experiment, this event takes a single parameter:
CategoryUpdateEvent
- guilded.on_category_delete(category)¶
A channel category was deleted.
If you are using the event style experiment, this event takes a single parameter:
CategoryDeleteEvent
- Parameters
category (
Category
) – The category that was deleted.
- guilded.on_server_channel_create(channel)¶
A channel was created in a server.
If you are using the event style experiment, this event takes a single parameter:
ServerChannelCreateEvent
- Parameters
channel (
abc.ServerChannel
) – The channel that was created.
- guilded.on_server_channel_update(before, after)¶
A server channel was updated.
If you are using the event style experiment, this event takes a single parameter:
ServerChannelUpdateEvent
- Parameters
before (
abc.ServerChannel
) – The channel before being updated.after (
abc.ServerChannel
) – The channel that was updated.
- guilded.on_server_channel_delete(channel)¶
A server channel was deleted.
If you are using the event style experiment, this event takes a single parameter:
ServerChannelDeleteEvent
- Parameters
channel (
abc.ServerChannel
) – The channel that was deleted.
Debug¶
- guilded.on_error(event, *args, **kwargs)¶
Usually when an event raises an uncaught exception, a traceback is printed to stderr and the exception is ignored. If you want to change this behaviour and handle the exception for whatever reason yourself, this event can be overridden. Which, when done, will suppress the default action of printing the traceback.
The information of the exception raised and the exception itself can be retrieved with a standard call to
sys.exc_info()
.If you want exception to propagate out of the
Client
class you can define anon_error
handler consisting of a single empty The raise statement. Exceptions raised byon_error
will not be handled in any way byClient
.- Parameters
event (
str
) – The name of the event that raised the exception.args – The positional arguments for the event that raised the exception.
kwargs – The keyword arguments for the event that raised the exception.
Docs¶
- guilded.on_doc_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A doc was created in a docs channel.
- Parameters
event (
DocCreateEvent
) – The event containing the payload.
- guilded.on_doc_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A doc was updated in a docs channel.
- Parameters
event (
DocUpdateEvent
) – The event containing the payload.
- guilded.on_doc_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A doc was deleted in a docs channel.
- Parameters
event (
DocDeleteEvent
) – The event containing the payload.
- guilded.on_doc_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a doc.
- Parameters
event (
DocReactionAddEvent
) – The event containing the payload.
- guilded.on_doc_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a doc.
- Parameters
event (
DocReactionRemoveEvent
) – The event containing the payload.
- guilded.on_doc_reply_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reply was created under a doc.
- Parameters
event (
DocReplyCreateEvent
) – The event containing the payload.
- guilded.on_doc_reply_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A doc reply was updated.
- Parameters
event (
DocReplyUpdateEvent
) – The event containing the payload.
- guilded.on_doc_reply_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A doc reply was deleted.
- Parameters
event (
DocReplyDeleteEvent
) – The event containing the payload.
- guilded.on_doc_reply_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a reply under a doc.
- Parameters
event (
DocReplyReactionAddEvent
) – The event containing the payload.
- guilded.on_doc_reply_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a reply under a doc.
- Parameters
event (
DocReplyReactionRemoveEvent
) – The event containing the payload.
Forums¶
- guilded.on_forum_topic_create(topic)¶
A forum topic was created.
If you are using the event style experiment, this event takes a single parameter:
ForumTopicCreateEvent
- Parameters
topic (
ForumTopic
) – The topic that was created.
- guilded.on_forum_topic_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic was updated.
- Parameters
event (
ForumTopicUpdateEvent
) – The event containing the payload.
- guilded.on_raw_forum_topic_update(topic)¶
If the event style experiment is enabled, this event will never be dispatched.
A forum topic was updated.
- Parameters
topic (
ForumTopic
) – The topic that was updated.
- guilded.on_forum_topic_delete(topic)¶
A forum topic was deleted.
If you are using the event style experiment, this event takes a single parameter:
ForumTopicDeleteEvent
- Parameters
topic (
ForumTopic
) – The topic that was deleted.
- guilded.on_forum_topic_pin(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic was pinned.
- Parameters
event (
ForumTopicPinEvent
) – The event containing the payload.
- guilded.on_forum_topic_unpin(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic was unpinned.
- Parameters
event (
ForumTopicUnpinEvent
) – The event containing the payload.
- guilded.on_forum_topic_lock(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic was locked.
- Parameters
event (
ForumTopicLockEvent
) – The event containing the payload.
- guilded.on_forum_topic_unlock(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic was unlocked.
- Parameters
event (
ForumTopicUnlockEvent
) – The event containing the payload.
- guilded.on_forum_topic_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a forum topic.
- Parameters
event (
ForumTopicReactionAddEvent
) – The event containing the payload.
- guilded.on_forum_topic_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a forum topic.
- Parameters
event (
ForumTopicReactionRemoveEvent
) – The event containing the payload.
- guilded.on_forum_topic_reply_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reply was created under a forum topic.
- Parameters
event (
ForumTopicReplyCreateEvent
) – The event containing the payload.
- guilded.on_forum_topic_reply_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic reply was updated.
- Parameters
event (
ForumTopicReplyUpdateEvent
) – The event containing the payload.
- guilded.on_forum_topic_reply_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A forum topic reply was deleted.
- Parameters
event (
ForumTopicReplyDeleteEvent
) – The event containing the payload.
- guilded.on_forum_topic_reply_reaction_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was added to a reply under a forum topic.
- Parameters
event (
ForumTopicReplyReactionAddEvent
) – The event containing the payload.
- guilded.on_forum_topic_reply_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
A reaction was removed from a reply under a forum topic.
- Parameters
event (
ForumTopicReplyReactionRemoveEvent
) – The event containing the payload.
Gateway¶
- guilded.on_ready()¶
Called when the client has connected to the gateway and filled its internal cache automatically.
Warning
This event will be called multiple times thoughout a process’s lifetime when the client resumes dropped gateway connections, so you should not do anything in a
ready
handler that you do not want to be done twice.For initial setup like loading extensions and cogs, use
Client.setup_hook()
.
- guilded.on_connect()¶
Called when the client has successfully connected to Guilded. This is not the same as the client being fully prepared, see
on_ready()
for that.
- guilded.on_disconnect()¶
Called when the client has disconnected from Guilded. This could happen either through the internet being disconnected, explicit calls to
Client.close()
, or Guilded terminating the connection one way or the other.This function can be called many times without a corresponding
on_connect()
call.
Groups¶
- guilded.on_group_create(group)¶
A group was created in a server.
If you are using the event style experiment, this event takes a single parameter:
GroupCreateEvent
- Parameters
group (
Group
) – The group that was created.
- guilded.on_group_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A group was updated in a server.
- Parameters
event (
GroupUpdateEvent
) – The event containing the payload.
- guilded.on_raw_group_update(group)¶
If the event style experiment is enabled, this event will never be dispatched.
A group was updated in a server.
- Parameters
group (
Group
) – The group that was updated.
- guilded.on_group_delete(group)¶
A group was deleted in a server.
If you are using the event style experiment, this event takes a single parameter:
GroupDeleteEvent
- Parameters
group (
Group
) – The group that was deleted.
List Items¶
- guilded.on_list_item_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A list item was created.
- Parameters
event (
ListItemCreateEvent
) – The event containing the payload.
- guilded.on_list_item_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A list item was updated.
- Parameters
event (
ListItemUpdateEvent
) – The event containing the payload.
- guilded.on_list_item_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A list item was deleted.
- Parameters
event (
ListItemDeleteEvent
) – The event containing the payload.
- guilded.on_list_item_complete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A list item was marked as complete.
- Parameters
event (
ListItemPinEvent
) – The event containing the payload.
- guilded.on_list_item_uncomplete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A list item was unmarked as complete.
- Parameters
event (
ListItemUnpinEvent
) – The event containing the payload.
Members¶
- guilded.on_member_join(member)¶
A member joined a server.
This event will also be dispatched if the member is the current user, which is a case you may want to explicitly ignore.
If you are using the event style experiment, this event takes a single parameter:
MemberJoinEvent
- Parameters
member (
Member
) – The member that joined.
- guilded.on_member_remove(member)¶
A member left or was forcibly removed from their server.
This event encompasses three cases of member removal. If the style experiment is disabled, you must use
on_member_leave()
,on_member_kick()
, oron_member_ban()
to fine-tune which cases you process in your code. Otherwise, you can check the attributes on the dispatchedMemberRemoveEvent
object.If you are using the event style experiment, this event takes a single parameter:
MemberRemoveEvent
- Parameters
member (
Member
) – The member that was removed.
- guilded.on_member_leave(member)¶
If the event style experiment is enabled, this event will never be dispatched.
A member manually left their server or their account was deleted.
- Parameters
member (
Member
) – The member that left.
- guilded.on_member_kick(member)¶
If the event style experiment is enabled, this event will never be dispatched.
A member was kicked from their server.
- Parameters
member (
Member
) – The member that was kicked.
- guilded.on_member_ban(member)¶
If the event style experiment is enabled, this event will never be dispatched.
A member was banned from their server.
- Parameters
member (
Member
) – The member that was banned.
- guilded.on_member_update(before, after)¶
A member was updated.
If the style experiment is disabled, then this event is only dispatched if the member was cached before being updated.
Any of the following attributes may have changed to cause this event to be dispatched:
Member.nickname
If you are using the event style experiment, this event takes a single parameter:
MemberUpdateEvent
- guilded.on_member_social_link_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A member created a social link on their profile.
- Parameters
event (
MemberSocialLinkCreateEvent
) – The event containing the payload.
- guilded.on_member_social_link_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A member updated one of their profile social links.
- Parameters
event (
MemberSocialLinkUpdateEvent
) – The event containing the payload.
- guilded.on_member_social_link_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A member deleted one of their profile social links.
- Parameters
event (
MemberSocialLinkDeleteEvent
) – The event containing the payload.
- guilded.on_ban_create(event)¶
This event will only be dispatched if the event style experiment is enabled.
A ban was created in a server (a member was banned). This is not necessarily equivalent to member removal.
- Parameters
event (
BanCreateEvent
) – The event containing the payload.
- guilded.on_ban_delete(event)¶
This event will only be dispatched if the event style experiment is enabled.
A ban was deleted in a server (a member was unbanned).
- Parameters
event (
BanDeleteEvent
) – The event containing the payload.
- guilded.on_bulk_member_roles_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A member’s roles were updated.
- Parameters
event (
BulkMemberRolesUpdateEvent
) – The event containing the payload.
- guilded.on_bulk_member_xp_add(event)¶
This event will only be dispatched if the event style experiment is enabled.
One or more members were awarded XP.
- Parameters
event (
BulkMemberXpAddEvent
) – The event containing the payload.
Messages¶
- guilded.on_message(message)¶
A message was sent in a server or DM.
If you are using the event style experiment, this event takes a single parameter:
MessageEvent
- Parameters
message (
ChatMessage
) – The message that was sent.
- guilded.on_message_edit(before, after)¶
If the event style experiment is enabled, this event will never be dispatched.
A message was updated.
This event is only dispatched if the message was cached before being updated. If you want to handle message updates regardless of state, see
on_raw_message_edit()
.- Parameters
before (
ChatMessage
) – The message before it was edited.after (
ChatMessage
) – The message that was edited in its current state.
- guilded.on_message_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A message was updated.
- Parameters
event (
MessageUpdateEvent
) – The event containing the payload.
- guilded.on_message_delete(message)¶
A message was deleted.
If you are using the event style experiment, this event takes a single parameter:
MessageDeleteEvent
- Parameters
message (
Message
) – The message that was deleted.
- guilded.on_raw_message_delete(data)¶
If the event style experiment is enabled, this event will never be dispatched.
A message was deleted.
Deprecated since version 1.11: The non-raw version of this event no longer relies on message cache. Use
on_message_delete()
instead.- Parameters
data (
dict
) –
- guilded.on_message_reaction_add(reaction)¶
A reaction was added to a message.
If you are using the event style experiment, this event takes a single parameter:
MessageReactionAddEvent
- Parameters
reaction (
Reaction
) – The reaction that was added.
- guilded.on_message_reaction_remove(reaction)¶
A reaction was removed from a message.
If you are using the event style experiment, this event takes a single parameter:
MessageReactionRemoveEvent
- Parameters
reaction (
Reaction
) – The reaction that was removed.
- guilded.on_bulk_message_reaction_remove(event)¶
This event will only be dispatched if the event style experiment is enabled.
One or multiple reactions were bulk removed from a message.
- Parameters
event (
BulkMessageReactionRemoveEvent
) – The event containing the payload.
Roles¶
- guilded.on_role_create(role)¶
A role was created in a server.
If you are using the event style experiment, this event takes a single parameter:
RoleCreateEvent
- Parameters
role (
Role
) – The role that was created.
- guilded.on_role_update(before, after)¶
A role was updated.
If you are using the event style experiment, this event takes a single parameter:
RoleUpdateEvent
- guilded.on_role_delete(role)¶
A role was deleted.
If you are using the event style experiment, this event takes a single parameter:
RoleDeleteEvent
- Parameters
role (
Role
) – The role that was deleted.
- guilded.on_channel_role_override_create(override)¶
A role override was created in a channel.
If you are using the event style experiment, this event takes a single parameter:
ChannelRoleOverrideCreateEvent
- Parameters
override (
ChannelRoleOverride
) – The override that was created.
- guilded.on_raw_channel_role_override_update(override)¶
If the event style experiment is enabled, this event will never be dispatched.
A role override was updated.
- Parameters
override (
ChannelRoleOverride
) – The override after modification.
- guilded.on_channel_role_override_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A role override was updated.
- Parameters
event (
ChannelRoleOverrideUpdateEvent
) – The event containing the payload.
- guilded.on_channel_role_override_delete(override)¶
A role override was deleted.
If you are using the event style experiment, this event takes a single parameter:
ChannelRoleOverrideDeleteEvent
- Parameters
override (
ChannelRoleOverride
) – The override that was deleted.
- guilded.on_category_role_override_create(override)¶
A role override was created in a category.
If you are using the event style experiment, this event takes a single parameter:
CategoryRoleOverrideCreateEvent
- Parameters
override (
CategoryRoleOverride
) – The override that was created.
- guilded.on_raw_category_role_override_update(override)¶
If the event style experiment is enabled, this event will never be dispatched.
A role override was updated.
- Parameters
override (
CategoryRoleOverride
) – The override after modification.
- guilded.on_category_role_override_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A role override was updated.
- Parameters
event (
CategoryRoleOverrideUpdateEvent
) – The event containing the payload.
- guilded.on_category_role_override_delete(override)¶
A role override was deleted.
If you are using the event style experiment, this event takes a single parameter:
CategoryRoleOverrideDeleteEvent
- Parameters
override (
CategoryRoleOverride
) – The override that was deleted.
Webhooks¶
- guilded.on_webhook_create(webhook)¶
A webhook was created in a server.
If you are using the event style experiment, this event takes a single parameter:
WebhookCreateEvent
- Parameters
webhook (
Webhook
) – The webhook that was created.
- guilded.on_webhook_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A webhook was updated or deleted in a server.
- Parameters
event (
WebhookUpdateEvent
) – The event containing the payload.
- guilded.on_raw_webhook_update(webhook)¶
If the event style experiment is enabled, this event will never be dispatched.
A webhook was updated or deleted in a server.
If the webhook was deleted, its
Webhook.deleted_at
attribute will be set.- Parameters
webhook (
Webhook
) – The webhook that was updated.
Users¶
- guilded.on_user_status_create(user, status, expires_at)¶
A user set their status.
If you are using the event style experiment, this event takes a single parameter:
UserStatusCreateEvent
- Parameters
user (
User
) – The user that updated their status.status (
Status
) – The new status.expires_at (Optional[
datetime.datetime
]) – When the status will expire, if applicable.
- guilded.on_user_status_delete(user, status)¶
A user deleted their status.
If you are using the event style experiment, this event takes a single parameter:
UserStatusDeleteEvent
- guilded.on_channel_user_override_create(override)¶
A user override was created in a channel.
If you are using the event style experiment, this event takes a single parameter:
ChannelUserOverrideCreateEvent
- Parameters
override (
ChannelUserOverride
) – The override that was created.
- guilded.on_raw_channel_user_override_update(override)¶
If the event style experiment is enabled, this event will never be dispatched.
A user override was updated.
- Parameters
override (
ChannelUserOverride
) – The override after modification.
- guilded.on_channel_user_override_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A user override was updated.
- Parameters
event (
ChannelUserOverrideUpdateEvent
) – The event containing the payload.
- guilded.on_channel_user_override_delete(override)¶
A user override was deleted.
If you are using the event style experiment, this event takes a single parameter:
ChannelUserOverrideDeleteEvent
- Parameters
override (
ChannelUserOverride
) – The override that was deleted.
- guilded.on_category_user_override_create(override)¶
A user override was created in a category.
If you are using the event style experiment, this event takes a single parameter:
CategoryUserOverrideCreateEvent
- Parameters
override (
CategoryUserOverride
) – The override that was created.
- guilded.on_raw_category_user_override_update(override)¶
If the event style experiment is enabled, this event will never be dispatched.
A user override was updated.
- Parameters
override (
CategoryUserOverride
) – The override after modification.
- guilded.on_category_user_override_update(event)¶
This event will only be dispatched if the event style experiment is enabled.
A user override was updated.
- Parameters
event (
CategoryUserOverrideUpdateEvent
) – The event containing the payload.
- guilded.on_category_user_override_delete(override)¶
A user override was deleted.
If you are using the event style experiment, this event takes a single parameter:
CategoryUserOverrideDeleteEvent
- Parameters
override (
CategoryUserOverride
) – The override that was deleted.
Event Wrappers¶
With the event style experiment enabled, many event handlers will receive one of the following subclasses. The basic structure of these event wrappers closely mirror the payloads provided by the Guilded API.
New in version 1.3.
- class guilded.BaseEvent¶
Represents a Gateway event for dispatching to event handlers.
All events inherit from this class, and thus have the following attributes:
- __dispatch_event__¶
The internal Pythonic event name to dispatch the event with. This is often, but not always, just a snake_case version of
__gateway_event__
in present tense rather than past (e.g.resource_create
vs.ResourceCreated
).- Type
- class guilded.MessageEvent¶
Represents a ChatMessageCreated event for dispatching to event handlers.
- message¶
The message that was sent.
- Type
- class guilded.MessageUpdateEvent¶
Represents a ChatMessageUpdated event for dispatching to event handlers.
- before¶
The message before modification, if it was cached.
- Type
Optional[
ChatMessage
]
- after¶
The message after modification.
- Type
- class guilded.MessageDeleteEvent¶
Represents a ChatMessageDeleted event for dispatching to event handlers.
- channel¶
The channel that the message was sent in.
- Type
Optional[
ServerChannel
]
- message¶
The message that was deleted.
- Type
- message_id¶
The ID of the message that was deleted.
Deprecated since version 1.11: The library populates this value with data from
message
. Use that attribute instead.- Type
- channel_id¶
The ID of the message’s channel.
Deprecated since version 1.11: The library populates this value with data from
message
. Use that attribute instead.- Type
- class guilded.BotAddEvent¶
Represents a BotServerMembershipCreated event for dispatching to event handlers.
New in version 1.5.
- class guilded.BotRemoveEvent¶
Represents a BotServerMembershipDeleted event for dispatching to event handlers.
New in version 1.6.
- class guilded.MemberJoinEvent¶
Represents a ServerMemberJoined event for dispatching to event handlers.
- class guilded.MemberRemoveEvent¶
Represents a ServerMemberRemoved event for dispatching to event handlers.
- class guilded.BanCreateEvent¶
Represents a ServerMemberBanned event for dispatching to event handlers.
- class guilded.BanDeleteEvent¶
Represents a ServerMemberUnbanned event for dispatching to event handlers.
- class guilded.MemberUpdateEvent¶
Represents a ServerMemberUpdated event for dispatching to event handlers.
- class guilded.BulkMemberRolesUpdateEvent¶
Represents a ServerRolesUpdated event for dispatching to event handlers.
This particular class only handles updates to role membership, not server roles.
- class guilded.MemberSocialLinkCreateEvent¶
Represents a ServerMemberSocialLinkCreated event for dispatching to event handlers.
- social_link¶
The social link that was created.
- Type
- class guilded.MemberSocialLinkUpdateEvent¶
Represents a ServerMemberSocialLinkUpdated event for dispatching to event handlers.
- social_link¶
The social link after modification.
- Type
- class guilded.MemberSocialLinkDeleteEvent¶
Represents a ServerMemberSocialLinkDeleted event for dispatching to event handlers.
- social_link¶
The social link that was deleted.
- Type
- class guilded.BulkMemberXpAddEvent¶
Represents a ServerXpAdded event for dispatching to event handlers.
This event is usually the result of flowbot actions like those provided in XP Bot.
- class guilded.ServerChannelCreateEvent¶
Represents a ServerChannelCreated event for dispatching to event handlers.
- channel¶
The channel that was created.
- Type
- class guilded.ServerChannelUpdateEvent¶
Represents a ServerChannelUpdated event for dispatching to event handlers.
- before¶
The channel before modification, if it was cached.
- Type
Optional[
abc.ServerChannel
]
- after¶
The channel after modification.
Deprecated since version 1.9: The
channel
alias.- Type
- class guilded.ServerChannelDeleteEvent¶
Represents a ServerChannelDeleted event for dispatching to event handlers.
- channel¶
The channel that was deleted.
- Type
- class guilded.WebhookCreateEvent¶
Represents a ServerWebhookCreated event for dispatching to event handlers.
- class guilded.WebhookUpdateEvent¶
Represents a ServerWebhookUpdated event for dispatching to event handlers.
- webhook¶
The webhook after modification. If
Webhook.deleted_at
is set, then this event indicates that the webhook was deleted.- Type
- class guilded.AnnouncementCreateEvent¶
Represents an AnnouncementCreated event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the announcement is in.
- Type
- announcement¶
The announcement that was created.
- Type
- class guilded.AnnouncementUpdateEvent¶
Represents an AnnouncementUpdated event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the announcement is in.
- Type
- announcement¶
The announcement after modification.
- Type
- class guilded.AnnouncementDeleteEvent¶
Represents an AnnouncementDeleted event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the announcement was in.
- Type
- announcement¶
The announcement that was deleted.
- Type
- class guilded.AnnouncementReactionAddEvent¶
Represents an AnnouncementReactionCreated event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.AnnouncementReactionRemoveEvent¶
Represents an AnnouncementReactionDeleted event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.AnnouncementReplyCreateEvent¶
Represents an AnnouncementCommentCreated event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reply is in.
- Type
- announcement¶
The announcement that the reply is under.
- Type
- reply¶
The reply that was created.
- Type
- class guilded.AnnouncementReplyUpdateEvent¶
Represents an AnnouncementCommentUpdated event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reply is in.
- Type
- announcement¶
The announcement that the reply is under.
- Type
- reply¶
The reply that was updated.
- Type
- class guilded.AnnouncementReplyDeleteEvent¶
Represents an AnnouncementCommentDeleted event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reply was in.
- Type
- announcement¶
The announcement that the reply was under.
- Type
- reply¶
The reply that was deleted.
- Type
- class guilded.AnnouncementReplyReactionAddEvent¶
Represents an AnnouncementCommentReactionCreated event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.AnnouncementReplyReactionRemoveEvent¶
Represents an AnnouncementCommentReactionDeleted event for dispatching to event handlers.
New in version 1.8.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.DocCreateEvent¶
Represents a DocCreated event for dispatching to event handlers.
- channel¶
The channel that the doc is in.
- Type
- class guilded.DocUpdateEvent¶
Represents a DocUpdated event for dispatching to event handlers.
- channel¶
The channel that the doc is in.
- Type
- class guilded.DocDeleteEvent¶
Represents a DocDeleted event for dispatching to event handlers.
- channel¶
The channel that the doc was in.
- Type
- class guilded.DocReactionAddEvent¶
Represents a DocReactionCreated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.DocReactionRemoveEvent¶
Represents a DocReactionDeleted event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.DocReplyCreateEvent¶
Represents a DocCommentCreated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reply is in.
- Type
- class guilded.DocReplyUpdateEvent¶
Represents a DocCommentUpdated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reply is in.
- Type
- class guilded.DocReplyDeleteEvent¶
Represents a DocCommentDeleted event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reply was in.
- Type
- class guilded.DocReplyReactionAddEvent¶
Represents a DocCommentReactionCreated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.DocReplyReactionRemoveEvent¶
Represents a DocCommentReactionDeleted event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.CalendarEventCreateEvent¶
Represents a CalendarEventCreated event for dispatching to event handlers.
- channel¶
The channel that the calendar event is in.
- Type
- calendar_event¶
The calendar event that was created.
- Type
- class guilded.CalendarEventUpdateEvent¶
Represents a CalendarEventUpdated event for dispatching to event handlers.
- channel¶
The channel that the calendar event is in.
- Type
- calendar_event¶
The calendar event after modification.
- Type
- class guilded.CalendarEventDeleteEvent¶
Represents a CalendarEventDeleted event for dispatching to event handlers.
- channel¶
The channel that the calendar event was in.
- Type
- calendar_event¶
The calendar event that was deleted.
- Type
- class guilded.CalendarEventReactionAddEvent¶
Represents a CalendarEventReactionCreated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.CalendarEventReactionRemoveEvent¶
Represents a CalendarEventReactionDeleted event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.CalendarEventReplyCreateEvent¶
Represents a CalendarEventCommentCreated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reply is in.
- Type
- calendar_event¶
The event that the reply is under.
- Type
- reply¶
The reply that was created.
- Type
- class guilded.CalendarEventReplyUpdateEvent¶
Represents a CalendarEventCommentUpdated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reply is in.
- Type
- calendar_event¶
The event that the reply is under.
- Type
- reply¶
The reply that was updated.
- Type
- class guilded.CalendarEventReplyDeleteEvent¶
Represents a CalendarEventCommentDeleted event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reply was in.
- Type
- calendar_event¶
The event that the reply was under.
- Type
- reply¶
The reply that was deleted.
- Type
- class guilded.CalendarEventReplyReactionAddEvent¶
Represents a CalendarEventCommentReactionCreated event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.CalendarEventReplyReactionRemoveEvent¶
Represents a CalendarEventCommentReactionDeleted event for dispatching to event handlers.
New in version 1.7.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.CategoryCreateEvent¶
Represents a CategoryCreated event for dispatching to event handlers.
New in version 1.11.
- class guilded.CategoryUpdateEvent¶
Represents a CategoryUpdated event for dispatching to event handlers.
New in version 1.11.
- class guilded.CategoryDeleteEvent¶
Represents a CategoryDeleted event for dispatching to event handlers.
New in version 1.11.
- class guilded.RsvpUpdateEvent¶
Represents a CalendarEventRsvpUpdated event for dispatching to event handlers.
- channel¶
The channel that the RSVP is in.
- Type
- rsvp¶
The RSVP that was created or updated.
- Type
CalendarEventRsvp
- class guilded.RsvpDeleteEvent¶
Represents a CalendarEventRsvpDeleted event for dispatching to event handlers.
- channel¶
The channel that the RSVP was in.
- Type
- rsvp¶
The RSVP that was deleted.
- Type
CalendarEventRsvp
- class guilded.BulkRsvpCreateEvent¶
Represents a CalendarEventRsvpManyUpdated event for dispatching to event handlers.
- channel¶
The channel that the RSVPs are in.
- Type
- rsvps¶
The RSVPs that were created.
- Type
List[
CalendarEventRsvp
]
- class guilded.ForumTopicCreateEvent¶
Represents a ForumTopicCreated event for dispatching to event handlers.
- channel¶
The channel that the forum topic is in.
- Type
- topic¶
The forum topic that was created.
- Type
- class guilded.ForumTopicUpdateEvent¶
Represents a ForumTopicUpdated event for dispatching to event handlers.
- channel¶
The channel that the forum topic is in.
- Type
- topic¶
The forum topic after modification.
- Type
- class guilded.ForumTopicDeleteEvent¶
Represents a ForumTopicDeleted event for dispatching to event handlers.
- channel¶
The channel that the forum topic was in.
- Type
- topic¶
The forum topic that was deleted.
- Type
- class guilded.ForumTopicPinEvent¶
Represents a ForumTopicPinned event for dispatching to event handlers.
- channel¶
The channel that the forum topic is in.
- Type
- topic¶
The forum topic that was pinned.
- Type
- class guilded.ForumTopicUnpinEvent¶
Represents a ForumTopicUnpinned event for dispatching to event handlers.
- channel¶
The channel that the forum topic is in.
- Type
- topic¶
The forum topic that was unpinned.
- Type
- class guilded.ForumTopicLockEvent¶
Represents a ForumTopicLocked event for dispatching to event handlers.
- channel¶
The channel that the forum topic is in.
- Type
- topic¶
The forum topic that was locked.
- Type
- class guilded.ForumTopicUnlockEvent¶
Represents a ForumTopicUnlocked event for dispatching to event handlers.
- channel¶
The channel that the forum topic is in.
- Type
- topic¶
The forum topic that was unlocked.
- Type
- class guilded.ForumTopicReactionAddEvent¶
Represents a ForumTopicReactionCreated event for dispatching to event handlers.
New in version 1.5.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.ForumTopicReactionRemoveEvent¶
Represents a ForumTopicReactionDeleted event for dispatching to event handlers.
New in version 1.5.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.ForumTopicReplyCreateEvent¶
Represents a ForumTopicCommentCreated event for dispatching to event handlers.
New in version 1.6.
- channel¶
The channel that the reply is in.
- Type
- topic¶
The topic that the reply is under.
- Type
- reply¶
The reply that was created.
- Type
- class guilded.ForumTopicReplyUpdateEvent¶
Represents a ForumTopicCommentUpdated event for dispatching to event handlers.
New in version 1.6.
- channel¶
The channel that the reply is in.
- Type
- topic¶
The topic that the reply is under.
- Type
- reply¶
The reply that was updated.
- Type
- class guilded.ForumTopicReplyDeleteEvent¶
Represents a ForumTopicCommentDeleted event for dispatching to event handlers.
New in version 1.6.
- channel¶
The channel that the reply was in.
- Type
- topic¶
The topic that the reply was under.
- Type
- reply¶
The reply that was deleted.
- Type
- class guilded.ForumTopicReplyReactionAddEvent¶
Represents a ForumTopicCommentReactionCreated event for dispatching to event handlers.
New in version 1.6.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.ForumTopicReplyReactionRemoveEvent¶
Represents a ForumTopicCommentReactionDeleted event for dispatching to event handlers.
New in version 1.6.
- channel¶
The channel that the reaction is in.
- Type
- class guilded.GroupCreateEvent¶
Represents a GroupCreated event for dispatching to event handlers.
- class guilded.GroupUpdateEvent¶
Represents a GroupUpdated event for dispatching to event handlers.
- class guilded.GroupDeleteEvent¶
Represents a GroupDeleted event for dispatching to event handlers.
- class guilded.ListItemCreateEvent¶
Represents a ListItemCreated event for dispatching to event handlers.
- channel¶
The channel that the list item is in.
- Type
- class guilded.ListItemUpdateEvent¶
Represents a ListItemUpdated event for dispatching to event handlers.
- channel¶
The channel that the list item is in.
- Type
- class guilded.ListItemDeleteEvent¶
Represents a ListItemDeleted event for dispatching to event handlers.
- channel¶
The channel that the list item was in.
- Type
- class guilded.ListItemCompleteEvent¶
Represents a ListItemCompleted event for dispatching to event handlers.
- channel¶
The channel that the list item is in.
- Type
- class guilded.ListItemUncompleteEvent¶
Represents a ListItemUncompleted event for dispatching to event handlers.
- channel¶
The channel that the list item is in.
- Type
- class guilded.MessageReactionAddEvent¶
Represents a ChannelMessageReactionCreated event for dispatching to event handlers.
- channel¶
The channel that the reaction is in.
- Type
Union[
ChatChannel
,VoiceChannel
,Thread
,DMChannel
]
- message¶
The message that the reaction is on, if it is cached.
- Type
Optional[
ChatMessage
]
- class guilded.MessageReactionRemoveEvent¶
Represents a ChannelMessageReactionDeleted event for dispatching to event handlers.
- channel¶
The channel that the reaction was in.
- Type
Union[
ChatChannel
,VoiceChannel
,Thread
,DMChannel
]
- message¶
The message that the reaction was on, if it is cached.
- Type
Optional[
ChatMessage
]
- class guilded.BulkMessageReactionRemoveEvent¶
Represents a ChannelMessageReactionManyDeleted event for dispatching to event handlers.
- channel¶
The channel that the reactions were in.
- Type
Union[
ChatChannel
,VoiceChannel
,Thread
,DMChannel
]
- message¶
The message that the reactions were on, if it is cached.
- Type
Optional[
ChatMessage
]
- class guilded.RoleCreateEvent¶
Represents a RoleCreated event for dispatching to event handlers.
- class guilded.RoleUpdateEvent¶
Represents a RoleUpdated event for dispatching to event handlers.
- class guilded.RoleDeleteEvent¶
Represents a RoleDeleted event for dispatching to event handlers.
- class guilded.ChannelRoleOverrideCreateEvent¶
Represents a ChannelRolePermissionCreated event for dispatching to event handlers.
- override¶
The role override that was created.
- Type
- class guilded.ChannelRoleOverrideUpdateEvent¶
Represents a ChannelRolePermissionUpdated event for dispatching to event handlers.
- override¶
The role override after modification.
- Type
- class guilded.ChannelRoleOverrideDeleteEvent¶
Represents a ChannelRolePermissionDeleted event for dispatching to event handlers.
- override¶
The role override that was deleted.
- Type
- class guilded.ChannelUserOverrideCreateEvent¶
Represents a ChannelUserPermissionCreated event for dispatching to event handlers.
- override¶
The user override that was created.
- Type
- class guilded.ChannelUserOverrideUpdateEvent¶
Represents a ChannelUserPermissionUpdated event for dispatching to event handlers.
- override¶
The user override after modification.
- Type
- class guilded.ChannelUserOverrideDeleteEvent¶
Represents a ChannelUserPermissionDeleted event for dispatching to event handlers.
- override¶
The user override that was deleted.
- Type
- class guilded.CategoryRoleOverrideCreateEvent¶
Represents a ChannelCategoryRolePermissionCreated event for dispatching to event handlers.
- override¶
The role override that was created.
- Type
- class guilded.CategoryRoleOverrideUpdateEvent¶
Represents a ChannelCategoryRolePermissionUpdated event for dispatching to event handlers.
- override¶
The role override after modification.
- Type
- class guilded.CategoryRoleOverrideDeleteEvent¶
Represents a ChannelCategoryRolePermissionDeleted event for dispatching to event handlers.
- override¶
The role override that was deleted.
- Type
- class guilded.CategoryUserOverrideCreateEvent¶
Represents a ChannelCategoryUserPermissionCreated event for dispatching to event handlers.
- override¶
The user override that was created.
- Type
- class guilded.CategoryUserOverrideUpdateEvent¶
Represents a ChannelCategoryUserPermissionUpdated event for dispatching to event handlers.
- override¶
The user override after modification.
- Type
- class guilded.CategoryUserOverrideDeleteEvent¶
Represents a ChannelCategoryUserPermissionDeleted event for dispatching to event handlers.
- override¶
The user override that was deleted.
- Type
- class guilded.UserStatusCreateEvent¶
Represents a UserStatusCreated event for dispatching to event handlers.
- expires_at¶
When the status will expire, if applicable.
- Type
Optional[
datetime.datetime
]
Enumerations¶
The API provides some enumerations for certain types of strings to avoid the API from being stringly typed in case the strings change in the future.
- class guilded.MediaType¶
Represents a file/attachment’s media type in Guilded.
- attachment¶
the media is an
Attachment
.
- content_media¶
the media is an
Attachment
.
- emoji¶
the media is an emoji.
- custom_reaction¶
the media is an emoji.
- embed_image¶
the media is a proxied image in a link embed.
- class guilded.FileType¶
Represents a type of file in Guilded. In the case of uploading files, this usually does not have to be set manually, but if the library fails to detect the type of file from its extension, you can pass this into
File
'sfile_type
parameter.- image¶
the file is an image
- video¶
the file is a video
- class guilded.ChannelType¶
A type of channel.
- announcements¶
the channel is an announcement channel.
- calendar¶
the channel is a calendar channel.
- chat¶
the channel is a chat or “text” channel.
- docs¶
the channel is a docs channel.
- forums¶
the channel is a forums channel.
- media¶
the channel is a media channel.
- news¶
the channel is an announcement channel. this is an alias of
announcements
.
- list¶
the channel is a list channel.
- scheduling¶
the channel is a scheduling channel.
- stream¶
the channel is a stream channel.
- voice¶
the channel is a voice channel.
- class guilded.ChannelVisibility¶
Restricts what users can view a channel.
- public¶
Visible to everyone, including members who are not part of the server. Threads cannot be
public
.
- private¶
Visible only to members who have been explicitly mentioned. Non-thread channels cannot be
private
.
- class guilded.FlowTriggerType¶
A type of flow trigger for
FlowBot
s.- server_updated¶
Server settings on the overview page changed
- member_muted¶
A member is muted on the server
- member_sent_message_to_channel¶
When someone sends a message to a channel
- member_joined¶
Via an application, an invite, or any other means
- application_received¶
When a user applies to the server
- event_created¶
An event is created in a calendar channel
- event_updated¶
An event is updated in a calendar channel
- event_removed¶
An event is deleted in a calendar channel
- forum_topic_created¶
A topic is created in a
ForumChannel
- forum_topic_updated¶
A topic is updated in a
ForumChannel
- forum_topic_deleted¶
A topic is deleted in a
ForumChannel
- list_item_created¶
A list item’s content is created in a
ListChannel
- list_item_updated¶
A list item’s content is updated in a
ListChannel
- list_item_deleted¶
A list item’s content is deleted in a
ListChannel
- doc_created¶
A doc is created in a
DocsChannel
- doc_updated¶
A doc is updated in a
DocsChannel
- doc_deleted¶
A doc is deleted in a
DocsChannel
- media_created¶
Media is created in a
MediaChannel
- media_updated¶
Media is updated in a
MediaChannel
- media_deleted¶
Media is deleted in a
MediaChannel
- announcement_created¶
An announcement is created in an
AnnouncementChannel
- announcement_updated¶
An announcement is updated in an
AnnouncementChannel
- announcement_deleted¶
An announcement is deleted in an
AnnouncementChannel
- voice_group_joined¶
A voice group is joined in a
VoiceChannel
- voice_group_left¶
A voice group is left in a
VoiceChannel
- twitch_stream_online¶
A Twitch stream has started
- twitch_stream_offline¶
A Twitch stream has stopped
- twitch_stream_subscribed¶
A user has subscribed to a Twitch stream
- twitch_stream_followed¶
A user has followed a Twitch stream
- twitch_stream_unfollowed¶
A user has unfollowed a Twitch stream
- twitch_stream_unsubscribed¶
A user has unsubscribed to a Twitch stream
- patreon_tiered_membership_created¶
A user has pledged to a campaign’s tier
- patreon_tiered_membership_updated¶
A user has updated their pledged tier in a campaign
- patreon_tiered_membership_cancelled¶
A user has cancelled their pledge to a campaign’s tier
- subscription_created¶
A member subscribes to the server
- subscription_updated¶
A member upgrades or downgrades their server subscription
- subscription_canceled¶
A member cancels their server subscription
- scheduling_availability_started¶
Availability started in a scheduling channel
- scheduling_availability_ended¶
Availability ended in a scheduling channel
- Missing youtube_video_published
New video posted from specified channel
- class guilded.FlowActionType¶
An action to perform when a
FlowTriggerType
is activated.- send_a_custom_message¶
Send a custom message
- assign_role¶
Assign a role
- add_xp_to_member¶
Add XP to a member
- edit_group_membership¶
Edit group membership
- create_a_forum_topic¶
Create a forum topic
- create_a_list_item¶
Create a list item
- remove_role¶
Remove a role
- delete_a_message¶
Delete a message
- create_a_doc¶
Create a doc
- class guilded.Presence¶
Represents a
User
's presence - the colored circle on their avatar in the client.- online¶
the user is online
- idle¶
the user is idle
- dnd¶
the user is on “do not disturb” mode
- do_not_disturb¶
the user is on “do not disturb” mode
- invisible¶
the user is offline or invisible
- offline¶
the user is offline or invisible
- class guilded.ServerType¶
A type of server.
- team¶
The server’s type is “Team”.
- organization¶
The server’s type is “Organization”.
- community¶
The server’s type is “Community”.
- clan¶
The server’s type is “Clan”.
- guild¶
The server’s type is “Guild”.
- friends¶
The server’s type is “Friends”.
- streaming¶
The server’s type is “Streaming”.
- other¶
The server’s type is “Other”.
- class guilded.SocialLinkType¶
A type of social link.
New in version 1.3.
- twitch¶
The social link is a Twitch connection.
- bnet¶
The social link is a Battle.net connection.
- psn¶
The social link is a Playstation Network connection.
- xbox¶
The social link is an Xbox connection.
- steam¶
The social link is a Steam connection.
- origin¶
The social link is an Origin connection.
- youtube¶
The social link is a YouTube connection.
- twitter¶
The social link is a Twitter connection.
- facebook¶
The social link is a Facebook connection.
- switch¶
The social link is a Nintendo Switch connection.
- patreon¶
The social link is a Patreon connection.
- roblox¶
The social link is a Roblox connection.
- epic¶
The social link is an Epic Games connection.
- class guilded.RepeatInterval¶
A basic repeat interval setting for calendar events.
New in version 1.7.
- once¶
The event will repeat once.
- daily¶
The event will repeat every day.
- weekly¶
The event will repeat every week.
- monthly¶
The event will repeat every month.
- custom¶
A custom repeat interval. When constructing a
RepeatInfo
, useCustomRepeatInterval
instead of this enum value.
- class guilded.CustomRepeatInterval¶
A custom repeat interval setting for calendar events. These intervals allow for more advanced repeat info.
New in version 1.7.
- daily¶
The event will repeat every day.
- weekly¶
The event will repeat every week.
- monthly¶
The event will repeat every month.
- class guilded.Weekday¶
A day of the week for
RepeatInfo
with theCustomRepeatInterval.weekly
interval.New in version 1.7.
- sunday¶
The event will repeat every Sunday.
- monday¶
The event will repeat every Monday.
- tuesday¶
The event will repeat every Tuesday.
- wednesday¶
The event will repeat every Wednesday.
- thursday¶
The event will repeat every Thursday.
- friday¶
The event will repeat every Friday.
- saturday¶
The event will repeat every Saturday.
Utility Functions¶
- guilded.utils.hyperlink(link, *, title=None)¶
A helper function to make links clickable when sent into chat.
Returns a markdown “named link”, e.g.
[Guilded](https://guilded.gg)
.
- guilded.utils.link(link, *, title=None)¶
Alias of
hyperlink()
.
- guilded.utils.new_uuid()¶
Generate a new, Guilded-compliant UUID.
- await guilded.utils.sleep_until(when, result=None)¶
This function is a coroutine.
Sleep until a specified time.
- Parameters
when (
datetime.datetime
) – The datetime to sleep until.result (Any) – Returned when the function finishes, if provided.
- guilded.utils.find(predicate, sequence)¶
Iterate through
sequence
to find a matching object forpredicate
.If nothing is found,
None
is returned.- Parameters
predicate (Callable) – A function that returns a boolean or boolean-like result.
sequence – An iterable to search through.
- guilded.utils.get(sequence, **attributes)¶
Return an object from
sequence
that matches theattributes
.If nothing is found,
None
is returned.- Parameters
sequence – An iterable to search through.
**attrs – Keyword arguments representing attributes of each item to match with.
- guilded.utils.remove_markdown(text, *, ignore_links=True)¶
A helper function that removes markdown characters.
Note
This function is not markdown aware and may remove meaning from the original text. For example, if the input contains
10 * 5
then it will be converted into10 5
.- Parameters
- Returns
The text with the markdown special characters removed.
- Return type
- guilded.utils.escape_markdown(text, *, as_needed=False, ignore_links=True)¶
A helper function that escapes markdown.
- Parameters
text (
str
) – The text to escape markdown from.as_needed (
bool
) – Whether to escape the markdown characters as needed. This means that it does not escape extraneous characters if it’s not necessary, e.g.**hello**
is escaped into\*\*hello**
instead of\*\*hello\*\*
. Note however that this can open you up to some clever syntax abuse. Defaults toFalse
.ignore_links (
bool
) – Whether to leave links alone when escaping markdown. For example, if a URL in the text contains characters such as_
then it will be left alone. This option is not supported withas_needed
. Defaults toTrue
.
- Returns
The text with the markdown special characters escaped with a slash.
- Return type
Webhooks¶
Webhooks are a convenient way to send messages to channels without any user or bot authentication.
Webhook¶
- class guilded.Webhook¶
Represents an asynchronous webhook.
There are two main ways to use Webhooks. The first is through the ones received by the library such as
Server.webhooks()
andChatChannel.webhooks()
. The ones received by the library will automatically be bound using the library’s internal HTTP session.The second form involves creating a webhook object manually using the
from_url()
orpartial()
classmethods.For example, creating a webhook from a URL and using aiohttp:
from guilded import Webhook import aiohttp async def foo(): async with aiohttp.ClientSession() as session: webhook = Webhook.from_url('url-here', session=session) await webhook.send('Hello World')
- x == y
Checks if two webhooks are equal.
- x != y
Checks if two webhooks are not equal.
- token¶
The authentication token of the webhook. If this is
None
then the webhook cannot be used to send messages.- Type
Optional[
str
]
- created_at¶
When the webhook was created.
- Type
- deleted_at¶
When the webhook was deleted.
- Type
Optional[
datetime.datetime
]
- classmethod partial(id, token, *, session, auth_token=None)¶
Creates a partial
Webhook
.- Parameters
id (
str
) – The ID of the webhook.token (
str
) – The authentication token of the webhook.session (
aiohttp.ClientSession
) – The session to use to send requests with. Note that the library does not manage the session and will not close it.auth_token (Optional[
str
]) – The bot authentication token for authenticated requests involving the webhook.
- Returns
A partial
Webhook
. A partial webhook is a webhook object with only an ID and a token.- Return type
- classmethod from_url(url, *, session, auth_token=None)¶
Creates a partial
Webhook
from a webhook URL.- Parameters
url (
str
) – The URL of the webhook.session (
aiohttp.ClientSession
) – The session to use to send requests with. Note that the library does not manage the session and will not close it.auth_token (Optional[
str
]) – The bot authentication token for authenticated requests involving the webhook. This is required to fetch and delete messages and the webhook itself.
- Returns
A partial
Webhook
. A partial webhook is a webhook object with only an ID and a token.- Return type
- Raises
ValueError – The URL is invalid.
- await fetch(*, server=None)¶
This function is a coroutine.
Fetches the current webhook.
This could be used to get a full webhook from a partial webhook.
This requires an authenticated webhook.
- Parameters
server (Optional[
Server
]) – The server that the webhook exists in. This is only required ifserver_id
isNone
.- Returns
The fetched webhook.
- Return type
- Raises
HTTPException – Could not fetch the webhook.
NotFound – Could not find the webhook by this ID.
ValueError – This instance of a webhook does not have authentication info associated with it or no server was provided but it is required.
- await delete(*, server=None)¶
This function is a coroutine.
Deletes this webhook.
This requires an authenticated webhook.
- Parameters
server (Optional[
Server
]) – The server that the webhook exists in. This is only required ifserver_id
isNone
.- Raises
HTTPException – Deleting the webhook failed.
NotFound – This webhook does not exist.
Forbidden – You do not have permissions to delete this webhook.
ValueError – This instance of a webhook does not have authentication info associated with it or no server was provided but it is required.
- await edit(*, name=..., channel=None, server=None)¶
This function is a coroutine.
Edits this webhook.
This requires an authenticated webhook.
- Parameters
name (Optional[
str
]) – The webhook’s new name.channel (Union[
ChatChannel
,ListChannel
]) – The channel to move the webhook to.server (Optional[
Server
]) – The server that the webhook exists in. This is only required ifserver_id
isNone
.
- Returns
The updated webhook.
- Return type
- Raises
HTTPException – Editing the webhook failed.
NotFound – This webhook does not exist.
ValueError – This instance of a webhook does not have authentication info associated with it or no server was provided but it is required.
- await move(to)¶
This function is a coroutine.
Moves this webhook to another channel.
- Parameters
to (Union[
ChatChannel
,ListChannel
]) – The channel to move the webhook to.- Returns
The updated webhook.
- Return type
- Raises
HTTPException – Editing the webhook failed.
NotFound – This webhook does not exist.
ValueError – This instance of a webhook does not have authentication info associated with it.
- await send(content=..., *, username=..., avatar_url=..., embed=..., embeds=..., file=..., files=...)¶
This function is a coroutine.
Sends a message or create a list item using this webhook.
Warning
If this webhook is in a
ListChannel
, this method will return aListItem
instead of aWebhookMessage
.The content must be a type that can convert to a string through
str(content)
.To upload a single file, the
file
parameter should be used with a singleFile
object.If the
embed
parameter is provided, it must be of typeEmbed
and it must be a rich embed type. You cannot mix theembed
parameter with theembeds
parameter, which must be alist
ofEmbed
objects to send.- Parameters
content (
str
) – Thecontent
of the message to send, or themessage
of the list item to create.username (
str
) –A custom username to use with this message instead of the webhook’s own username.
New in version 1.4.
avatar_url (
str
) –A custom avatar URL to use with this message instead of the webhook’s own avatar. This is explicitly cast to
str
if it is not already.New in version 1.4.
file (
File
) – The file to upload. This cannot be mixed withfiles
parameter.files (List[
File
]) – A list of files to send. This cannot be mixed with thefile
parameter.embed (
Embed
) – The rich embed for the content to send. This cannot be mixed withembeds
parameter.embeds (List[
Embed
]) – A list of embeds to send. Maximum of 10. This cannot be mixed with theembed
parameter.
- Returns
If this webhook is in a
ChatChannel
, theWebhookMessage
that was sent. Otherwise, theListItem
that was created.- Return type
Union[
WebhookMessage
,ListItem
]- Raises
HTTPException – Executing the webhook failed.
NotFound – This webhook was not found.
Forbidden – The token for the webhook is incorrect.
TypeError – You specified both
embed
andembeds
orfile
andfiles
.ValueError – The length of
embeds
was invalid or there was no token associated with this webhook.
- property avatar¶
Returns an
Asset
for the avatar the webhook has.If the webhook does not have an uploaded avatar,
None
is returned. If you want the avatar that the webhook displays, considerdisplay_avatar
instead.- Type
Optional[
Asset
]
- property channel¶
The channel this webhook belongs to.
If this is a partial webhook, then this will always return
None
.- Type
Optional[Union[
ChatChannel
,ListChannel
]]
- property display_avatar¶
Returns the webhook’s display avatar.
This is either webhook’s default avatar or uploaded avatar.
- Type
- await fetch_message(message_id, /, *, channel=None)¶
This function is a coroutine.
Retrieves a single
WebhookMessage
sent by this webhook.This requires an authenticated webhook.
- Parameters
id (
str
) – The message ID to look for.channel (Optional[
ChatChannel
]) – The channel that this message exists in. This is only required ifchannel_id
isNone
.
- Returns
The message that was asked for.
- Return type
- Raises
NotFound – The specified message was not found.
Forbidden – You do not have the permissions required to get a message.
HTTPException – Retrieving the message failed.
ValueError – This instance of a webhook does not have authentication info associated with it or no channel was provided but it is required.
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.- Type
Optional[
Server
]
- is_authenticated()¶
bool
: Whether the webhook has non-webhook authentication information associated with it.If this is not
True
, you will not be able to manage messages sent by this webhook, nor delete or edit the webhook itself.
- property server¶
The server this webhook belongs to.
If this is a partial webhook, then this will always return
None
.- Type
Optional[
Server
]
- await delete_message(message_id, /, *, channel=None)¶
This function is a coroutine.
Deletes a message sent by this webhook.
This is a lower level interface to
WebhookMessage.delete()
in case you only have an ID.This requires an authenticated webhook.
- Parameters
message_id (
str
) – The message ID to delete.channel (Optional[
ChatChannel
]) – The channel that this message exists in. This is only required ifchannel_id
isNone
.
- Raises
HTTPException – Deleting the message failed.
Forbidden – Deleted a message that is not yours.
ValueError – This instance of a webhook does not have authentication info associated with it or no channel was provided but it is required.
WebhookMessage¶
- class guilded.WebhookMessage¶
Represents a message sent from your webhook.
This allows you to delete a message sent by your webhook, although the parent webhook requires authentication information.
This inherits from
ChatMessage
with changes todelete()
to work.- await edit(*args, **kwargs)¶
This function is a coroutine.
Edit this message.
Warning
This method overwrites all content previously in the message using the new payload.
- Parameters
content (
str
) – The text content of the message.embed (
Embed
) – An embed in the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds in the message. At present, this can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
- Returns
The edited message.
- Return type
- Raises
NotFound – The message does not exist.
Forbidden – The message is not owned by you or it is in a channel you cannot access.
HTTPException – Could not edit the message.
- await delete(*, delay=None)¶
This function is a coroutine.
Deletes the message.
- Parameters
delay (Optional[
float
]) – If provided, the number of seconds to wait before deleting the message. The waiting is done in the background and deletion failures are ignored.- Raises
Forbidden – You do not have proper permissions to delete the message.
NotFound – The message was deleted already.
HTTPException – Deleting the message failed.
ValueError – This instance of a webhook does not have authentication info associated with it.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this message.
- Parameters
emote (
Emote
) – The emote to add.
- property author¶
The user that created this message, if they are cached.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- await clear_reaction(emote, /)¶
This function is a coroutine.
Bulk remove reactions from this message based on their emote.
To remove individual reactions from specific users, see
remove_reaction()
.New in version 1.9.
- Parameters
emote (
Emote
) – The emote to remove.
- await clear_reactions()¶
This function is a coroutine.
Bulk remove all the reactions from this message.
New in version 1.9.
- await create_thread(name, *, visibility=None)¶
This function is a coroutine.
Create a new thread under the message.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server this message was sent in.
- Type
Optional[
Server
]
- property jump_url¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
share_url
.The share URL of the message.
- Type
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- await pin()¶
This function is a coroutine.
Pin this message.
New in version 1.10.
- Raises
NotFound – The channel or message does not exist.
Forbidden – You are not allowed to pin messages in this channel.
HTTPException – Failed to pin the message.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
- property raw_user_mentions¶
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- await remove_reaction(emote, member=None)¶
This function is a coroutine.
Remove a reaction from this message.
If the reaction is not your own then
manage_messages
is required.New in version 1.9.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this message.
Deprecated since version 1.9: Use
remove_reaction()
instead.- Parameters
emote (
Emote
) – The emote to remove.
- property replied_to¶
The list of messages that the message replied to.
This property relies on message cache. If you need a list of IDs, consider
replied_to_ids
instead.- Type
List[
ChatMessage
]
- await reply(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None)¶
This function is a coroutine.
Reply to this message. This is identical to
abc.Messageable.send()
, but thereply_to
parameter already includes this message.
The share URL of the message.
- Type
- await unpin()¶
This function is a coroutine.
Unpin this message.
New in version 1.10.
- Raises
NotFound – The channel or message does not exist.
Forbidden – You are not allowed to unpin messages in this channel.
HTTPException – Failed to unpin the message.
Abtract Base Classes¶
Abtract base classes are classes that some models inherit from in order to get their behaviour. They are not to be user-instantiated.
Messageable¶
- class guilded.abc.Messageable¶
An ABC for models that messages can be sent to.
The following implement this ABC:
DMChannel
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
Permissions.read_messages
Permissions.hear_voice
Permissions.view_streams
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
User¶
- class guilded.abc.User¶
An ABC for user-type models.
The following implement this ABC:
- bot_id¶
The user’s corresponding bot ID, if any. This will likely only be available for the connected
ClientUser
.- Type
Optional[
str
]
- created_at¶
When the user’s account was created. This may be
None
if the user object was partial.- Type
Optional[
datetime.datetime
]
- property mention¶
The mention string for this user.
This will render and deliver a mention when sent in an
Embed
.- Type
- property bot¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
Whether the user is a bot account or webhook.
- Type
ServerChannel¶
- class guilded.abc.ServerChannel¶
An ABC for the various types of server channels.
The following implement this ABC:
The share URL of the channel.
- Type
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
Reply¶
- class guilded.abc.Reply¶
An ABC for replies to posts.
The following implement this ABC:
- x == y
Checks if two replies are equal.
- x != y
Checks if two replies are not equal.
- hash(x)
Returns the reply’s hash.
- created_at¶
When the reply was created.
- Type
- updated_at¶
When the reply was last updated.
- Type
Optional[
datetime.datetime
]
- property channel¶
The channel that the reply is in.
- Type
Guilded Models¶
Models are classes that are constructed using data recieved directly from Guilded and are not meant to be created by the user of the library.
Danger
The classes listed below are not intended to be created by users.
For example, this means that you should not make your own User
instances nor should you modify a User
instance yourself.
If you want to get one of these model classes instances they’d have to be
through the cache, and a common way of doing so is through the utils.find()
function or attributes of model classes that you receive from the events
specified in the Event Reference.
Announcement¶
- class guilded.Announcement¶
Represents an announcement in an
AnnouncementChannel
.- x == y
Checks if two announcements are equal.
- x != y
Checks if two announcements are not equal.
- hash(x)
Returns the hash of the announcement.
- str(x)
Returns the title of the announcement.
New in version 1.8.
- channel¶
The channel that the announcement is in.
- Type
- created_at¶
When the announcement was created.
- Type
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the announcement is in.
- Type
- await edit(*, title=..., content=...)¶
This function is a coroutine.
Edit this announcement.
All parameters are optional.
- Parameters
- Returns
The newly edited announcement.
- Return type
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this announcement.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this announcement.
- Parameters
emote (
Emote
) – The emote to remove.
- await reply(content)¶
This function is a coroutine.
Reply to this announcement.
- Parameters
content (
str
) – The content of the reply.- Returns
The created reply.
- Return type
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to reply to this topic.
HTTPException – Failed to reply to this topic.
- await fetch_reply(reply_id, /)¶
This function is a coroutine.
Fetch a reply to this announcement.
- Returns
The reply from the ID.
- Return type
- Raises
NotFound – This reply or announcement does not exist.
Forbidden – You do not have permission to read this announcement’s replies.
HTTPException – Failed to fetch the reply.
- await fetch_replies()¶
This function is a coroutine.
Fetch all replies to this announcement.
- Returns
The replies under the announcement.
- Return type
List[
AnnouncementReply
]- Raises
NotFound – This announcement does not exist.
Forbidden – You do not have permission to read this announcement’s replies.
HTTPException – Failed to fetch the replies to this announcement.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
AnnouncementChannel¶
- class guilded.AnnouncementChannel¶
Represents an announcement channel in a
Server
.- property blog_url¶
The blog URL of the announcement channel.
Note
Due to an API limitation, this property cannot check if the channel is set as a blog, and it assumes the slug based on the channel’s
name
.- Type
Optional[
str
]
- await fetch_announcement(announcement_id, /)¶
This function is a coroutine.
Fetch an announcement in this channel.
- Returns
The announcement from the ID.
- Return type
- await fetch_announcements(*, limit=None, before=None)¶
This function is a coroutine.
Fetch multiple announcements in this channel.
All parameters are optional.
- Parameters
limit (
int
) – The maximum number of announcements to return. Defaults to 25.before (
datetime.datetime
) – The latest date that an announcement can be from. Defaults to the current time.
- Returns
The announcements in the channel.
- Return type
List[
Announcement
]
- await create_announcement(*, title, content)¶
This function is a coroutine.
Create an announcement in this channel.
- Parameters
- Returns
The created announcement.
- Return type
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
AnnouncementReply¶
- class guilded.AnnouncementReply¶
Represents a reply to an
Announcement
.- x == y
Checks if two replies are equal.
- x != y
Checks if two replies are not equal.
- hash(x)
Returns the reply’s hash.
New in version 1.8.
- parent¶
The announcement that the reply is a child of.
- Type
- created_at¶
When the reply was created.
- Type
- updated_at¶
When the reply was last updated.
- Type
Optional[
datetime.datetime
]
- await edit(*, content)¶
This function is a coroutine.
Edit this reply.
- Parameters
content (
str
) – The content of the reply.- Returns
The updated reply.
- Return type
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to update this reply.
HTTPException – Failed to update this reply.
- await delete()¶
This function is a coroutine.
Delete this reply.
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to delete this reply.
HTTPException – Failed to delete this reply.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this reply.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this reply.
- Parameters
emote (
Emote
) – The emote to remove.
- property channel¶
The channel that the reply is in.
- Type
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
Asset¶
- class guilded.Asset¶
Represents an asset in Guilded.
- x == y
Checks if two assets are equal (have the same URL).
- x != y
Checks if two assets are not equal.
- str(x)
Returns the URL of the asset.
- len(x)
Returns the length of the asset’s URL.
- bool(x)
Returns
True
if the asset has a URL.
- property aws_url¶
The underlying URL of the asset on AWS.
Deprecated since version 1.13: This type of URL should no longer be required, and it seems to be getting phased out by Guilded. Use
url
instead.- Type
- is_animated()¶
bool
: Returns whether the asset is animated.Note
This may return false negatives for assets like user or bot avatars which have no definitive indicator.
- replace(*, size=None, format=None, static_format=None)¶
Returns a new asset with the passed components replaced.
Warning
If this asset is a user or bot avatar, you should not replace
format
because avatars uploaded after 10 May 2022 can only use thewebp
format.- Parameters
size (
str
) – The new size of the asset. Must be one of ‘Small’, ‘Medium’, ‘Large’, or ‘HeroMd’ or ‘Hero’ if it’s a banner.format (
str
) – The new format to change it to. Must be one of ‘webp’, ‘jpeg’, ‘jpg’, ‘png’, or ‘gif’ or ‘apng’ if it’s animated.static_format (
str
) – The new format to change it to if the asset isn’t animated. Must be either ‘webp’, ‘jpeg’, ‘jpg’, or ‘png’.
- Raises
InvalidArgument – An invalid size or format was passed.
- Returns
The newly updated asset.
- Return type
- with_size(size)¶
Returns a new asset with the specified size.
- Parameters
size (
str
) – The new size of the asset. Must be one of ‘Small’, ‘Medium’, ‘Large’, or ‘HeroMd’ or ‘Hero’ if it’s a banner.- Raises
InvalidArgument – The asset had an invalid size.
- Returns
The newly updated asset.
- Return type
- with_format(format)¶
Returns a new asset with the specified format.
Warning
If this asset is a user or bot avatar, you should not use this method because avatars uploaded after 10 May 2022 can only use the
webp
format.- Parameters
format (
str
) – The new format of the asset.- Raises
InvalidArgument – The asset had an invalid format.
- Returns
The newly updated asset.
- Return type
- with_static_format(format)¶
Returns a new asset with the specified static format.
This only changes the format if the underlying asset is not animated. Otherwise, the asset is not changed.
- Parameters
format (
str
) – The new static format of the asset.- Raises
InvalidArgument – The asset had an invalid format.
- Returns
The newly updated asset.
- Return type
Attachment¶
- class guilded.Attachment¶
An uploaded attachment in a message, announcement, document, or any other place you can upload files inline with content.
The attachment’s caption.
- Type
Optional[
str
]
Availability¶
- class guilded.Availability¶
Represents an availability in a
SchedulingChannel
.- x == y
Checks if two availabilities are equal.
- x != y
Checks if two availabilities are not equal.
- hash(x)
Returns the hash of the availability.
- start¶
When the availability starts.
- Type
- end¶
When the availability ends.
- Type
- created_at¶
When the availabilty was created.
- Type
- updated_at¶
When the availabilty was updated.
- Type
Optional[
datetime.datetime
]
- channel¶
The channel that the availability is in.
- Type
CalendarChannel¶
- class guilded.CalendarChannel¶
Represents a calendar channel in a
Server
.- await create_event(name, *, starts_at, duration=..., description=..., location=..., url=..., colour=..., color=..., all_day=..., rsvp_limit=..., rsvp_disabled=..., autofill_waitlist=..., private=..., roles=..., repeat=...)¶
This function is a coroutine.
Create an event in this channel.
- Parameters
name (
str
) – The name of the event.starts_at (
datetime.datetime
) – When the event starts.duration (Optional[Union[
datetime.timedelta
,int
]]) – The duration of the event. If this is anint
, the value must be in minutes.description (Optional[
str
]) – The description of the event.location (Optional[
str
]) – The location of the event.url (Optional[
str
]) – A URL to associate with the event.colour (Optional[Union[
Colour
,int
]]) – The colour of the event when viewing in the channel. This parameter is also aliased tocolor
.all_day (Optional[
bool
]) –Whether the event should last all day.
New in version 1.8.
rsvp_limit (Optional[
int
]) –The number of RSVPs to allow before waitlisting.
New in version 1.7.
rsvp_disabled (Optional[
bool
]) –Whether users should be disallowed from creating RSVPs for the event.
New in version 1.8.
autofill_waitlist (Optional[
bool
]) –When
rsvp_limit
is set, whether users from the waitlist should be added as space becomes available in the event.New in version 1.8.
private (Optional[
bool
]) – Whether the event should be private.roles (Optional[List[
Role
]]) –The roles to restrict the event to.
New in version 1.8.
repeat (Optional[Union[
RepeatInterval
,RepeatInfo
]]) –A basic interval for repeating the event or a
RepeatInfo
for more detailed repeat options.New in version 1.7.
- Returns
The created event.
- Return type
- Raises
Forbidden – You do not have permissions to create events.
HTTPException – Failed to create the event.
- await fetch_event(event_id, /)¶
This function is a coroutine.
Fetch an event in this channel from the API.
- Returns
The event from the ID.
- Return type
- Raises
NotFound – There is no event with the ID.
Forbidden – You do not have permissions to get events in this channel.
HTTPException – Failed to get the event.
- async for ... in events(limit=25, after=None, before=None)¶
An asynchronous iterator for the events in this channel.
Results are ordered ascending by
CalendarEvent.starts_at
.Examples
Usage
async for event in channel.events(): print(f'{event} starts at {event.starts_at}')
Flattening into a list
events = [event async for event in channel.events()] # events is now a list of CalendarEvent
- Parameters
limit (Optional[
int
]) – The maximum number of events to return. Defaults to 25 if not specified.before (Optional[Union[
CalendarEvent
,datetime.datetime
]]) – The event to stop pagination at.after (Optional[Union[
CalendarEvent
,datetime.datetime
]]) – The event to begin pagination at.
- Yields
CalendarEvent
– An event in this channel.- Raises
Forbidden – You do not have permissions to get events in this channel.
HTTPException – Failed to get the events.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
CalendarEvent¶
- class guilded.CalendarEvent¶
Represents an event in a
CalendarChannel
.- x == y
Checks if two events are equal.
- x != y
Checks if two events are not equal.
- hash(x)
Returns the hash of the event.
- str(x)
Returns the name of the event.
- x < y
Checks if an event starts before another event.
- x > y
Checks if an event starts after another event.
- x <= y
Checks if an event starts before or at the same time as another event.
- x >= y
Checks if an event starts after or at the same time as another event.
New in version 1.2.
- channel¶
The channel that the event is in.
- Type
- created_at¶
When the event was created.
- Type
- starts_at¶
When the event starts.
- Type
Optional[
datetime.datetime
]
- url¶
A URL to associate with the event. This is not an in-app share link, but rather something that is set by users while creating the event.
- Type
Optional[
str
]
- role_ids¶
The role IDs that the event is restricted to. If the event is not restricted, this list is empty.
New in version 1.8.
- Type
List[
int
]
- rsvp_limit¶
The number of RSVPs to allow before waitlisting RSVPs.
New in version 1.7.
- Type
Optional[
int
]
- rsvp_disabled¶
Whether users are disallowed from creating RSVPs for the event.
New in version 1.8.
- Type
Optional[
bool
]
- autofill_waitlist¶
When
rsvp_limit
is set, whether users from the waitlist should be added as space becomes available in the event.New in version 1.8.
- Type
Optional[
bool
]
- duration¶
The duration of the event. Minimum 60 seconds.
- Type
Optional[
datetime.timedelta
]
- cancellation_description¶
The description of the event cancellation, if any.
There is an alias for this attribute called
cancelation_description
.- Type
Optional[
str
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the event is in.
- Type
- property cancelation_description¶
The description of the event cancelation, if any.
There is an alias for this attribute called
cancellation_description
.- Type
Optional[
str
]
- property cancelled_by¶
The member that cancelled the event, if applicable.
There is an alias for this attribute called
canceled_by
.- Type
Optional[
Member
]
- property canceled_by¶
The member that canceled the event, if applicable.
There is an alias for this attribute called
cancelled_by
.- Type
Optional[
Member
]
- property roles¶
The roles that the event is restricted to. If the event is not restricted, this list is empty.
New in version 1.8.
- Type
List[
Role
]
- await edit(*, name=..., description=..., location=..., starts_at=..., url=..., colour=..., color=..., duration=..., all_day=..., rsvp_limit=..., rsvp_disabled=..., autofill_waitlist=..., private=..., roles=..., repeat=..., edit_series=...)¶
This function is a coroutine.
Edit this event.
All parameters are optional.
- Parameters
name (
str
) – The name of the event.description (
str
) – The description of the event.location (
str
) – The location of the event.starts_at (
datetime.datetime
) – When the event starts.url (
str
) – A URL to associate with the event.colour (Union[
Colour
,int
]) – The colour of the event when viewing in the channel. This parameter is also aliased tocolor
.duration (Union[
datetime.timedelta
,int
]) – The duration of the event. If this is anint
, the value must be in minutes.all_day (Optional[
bool
]) –Whether the event should last all day.
New in version 1.8.
rsvp_limit (Optional[
int
]) –The number of RSVPs to allow before waitlisting.
New in version 1.7.
rsvp_disabled (Optional[
bool
]) –Whether users should be disallowed from creating RSVPs for the event.
New in version 1.8.
autofill_waitlist (Optional[
bool
]) –When
rsvp_limit
is set, whether users from the waitlist should be added as space becomes available in the event.New in version 1.8.
private (
bool
) – Whether the event should be private.roles (Optional[List[
Role
]]) –The roles to restrict the event to.
New in version 1.8.
repeat (Optional[Union[
RepeatInterval
,RepeatInfo
]]) –A basic interval for repeating the event or a
RepeatInfo
for more detailed repeat options.New in version 1.7.
edit_series (
bool
) –Whether to also edit all future events in the series, if applicable.
New in version 1.7.
- Returns
The newly edited event.
- Return type
- Raises
NotFound – The event has been deleted.
Forbidden – You do not have permissions to edit the event.
HTTPException – Failed to edit the event.
- await delete(*, series=None)¶
This function is a coroutine.
Delete this event.
- Parameters
series (Optional[
DeleteSeriesType
]) –If the event is part of a series (i.e.
repeats
isTrue
), sets whether to delete all events in the series or only this one and its subsequent events. IfNone
or not provided, only this event will be deleted.New in version 1.7.
- Raises
NotFound – The event has already been deleted.
Forbidden – You do not have permissions to delete the event.
HTTPException – Failed to delete the event.
- await create_rsvp(user, /, *, status)¶
This function is a coroutine.
Create an RSVP for a user.
This method can also be used for editing an existing RSVP, which may be preferable if all you need to do is edit it.
- Parameters
user (
User
) – The user to create an RSVP for.status (
RSVPStatus
) – The status of the RSVP.
- Returns
The newly created RSVP.
- Return type
- Raises
Forbidden – You do not have permissions to create an RSVP for another user.
HTTPException – Failed to create an RSVP.
- await upsert_rsvps(*users, status)¶
This function is a coroutine.
Upsert (conditionally create or edit) RSVPs for multiple users.
New in version 1.8.
- Parameters
*users (
User
) – The users to upsert RSVPs for.status (
RSVPStatus
) – The status of the RSVPs.
- Raises
Forbidden – You do not have permissions to upsert RSVPs for other users.
HTTPException – Failed to upsert RSVPs.
- await fetch_rsvp(user, /)¶
This function is a coroutine.
Fetch a user’s RSVP to this event.
- Returns
The user’s RSVP.
- Return type
- Raises
NotFound – This user does not have an RSVP for this event.
HTTPException – Failed to fetch this user’s RSVP.
- await fetch_rsvps()¶
This function is a coroutine.
Fetch all RSVPs to this event.
- Returns
A user’s RSVP.
- Return type
- Raises
HTTPException – Failed to fetch the RSVPs.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this event.
New in version 1.7.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this event.
New in version 1.7.
- Parameters
emote (
Emote
) – The emote to remove.
- await reply(content)¶
This function is a coroutine.
Reply to this event.
New in version 1.7.
- Parameters
content (
str
) – The content of the reply.- Returns
The created reply.
- Return type
- Raises
NotFound – This event does not exist.
Forbidden – You do not have permission to reply to this event.
HTTPException – Failed to reply to this event.
- await fetch_reply(reply_id, /)¶
This function is a coroutine.
Fetch a reply to this event.
New in version 1.7.
- Returns
The reply from the ID.
- Return type
- Raises
NotFound – This reply or event does not exist.
Forbidden – You do not have permission to read this event’s replies.
HTTPException – Failed to fetch the reply.
- await fetch_replies()¶
This function is a coroutine.
Fetch all replies to this event.
New in version 1.7.
- Returns
The replies under the event.
- Return type
List[
CalendarEventReply
]- Raises
NotFound – This event does not exist.
Forbidden – You do not have permission to read this event’s replies.
HTTPException – Failed to fetch the replies to this event.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
CalendarEventReply¶
- class guilded.CalendarEventReply¶
Represents a reply to a
CalendarEvent
.- x == y
Checks if two replies are equal.
- x != y
Checks if two replies are not equal.
- hash(x)
Returns the reply’s hash.
New in version 1.7.
- parent¶
The event that the reply is a child of.
- Type
- created_at¶
When the reply was created.
- Type
- updated_at¶
When the reply was last updated.
- Type
Optional[
datetime.datetime
]
- await edit(*, content)¶
This function is a coroutine.
Edit this reply.
- Parameters
content (
str
) – The content of the reply.- Returns
The updated reply.
- Return type
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to update this reply.
HTTPException – Failed to update this reply.
- await delete()¶
This function is a coroutine.
Delete this reply.
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to delete this reply.
HTTPException – Failed to delete this reply.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this reply.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this reply.
- Parameters
emote (
Emote
) – The emote to remove.
- property channel¶
The channel that the reply is in.
- Type
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
CalendarEventRSVP¶
- class guilded.CalendarEventRSVP¶
Represents an RSVP to a
CalendarEvent
.- x == y
Checks if two RSVPs are equal.
- x != y
Checks if two RSVPs are not equal.
New in version 1.2.
- event¶
The event that the RSVP is for.
- Type
- status¶
The status of the RSVP.
- Type
RSVPStatus
- created_at¶
When the RSVP was created.
- Type
- updated_at¶
When the RSVP was last updated.
- Type
- property channel¶
The channel that the RSVP’s event is in.
- Type
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the RSVP’s event is in.
- Type
- await edit(*, status)¶
This function is a coroutine.
Edit this RSVP.
- Parameters
status (
RSVPStatus
) – The status of the RSVP.- Returns
The newly edited RSVP.
- Return type
- Raises
Forbidden – You do not have permissions to edit this RSVP.
NotFound – This RSVP was deleted.
HTTPException – Failed to edit this RSVP.
- await delete()¶
This function is a coroutine.
Delete this RSVP.
- Raises
Forbidden – You do not have permissions to delete this RSVP.
NotFound – This RSVP was already deleted.
HTTPException – Failed to delete this RSVP.
Category¶
- class guilded.Category¶
Represents a channel category.
- x == y
Checks if two categories are equal.
- x != y
Checks if two categories are not equal.
- hash(x)
Returns the category’s hash.
- str(x)
Returns the name of the category.
New in version 1.11.
- priority¶
The priority of the category in relation to other categories in the group. Higher values are displayed higher in the UI. If this is
None
, the category is to be sorted descending bycreated_at
.New in version 1.12.
- Type
Optional[
int
]
- created_at¶
When the category was created.
- Type
- updated_at¶
When the category was last updated.
- Type
Optional[
datetime.datetime
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this category is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.
- await edit(*, name=None, priority=None)¶
This function is a coroutine.
Edit this category.
All parameters are optional.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this category.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this category.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this category.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
CategoryRoleOverride
]
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this category.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this category.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this category.
New in version 1.11.
- Parameters
user (
Member
) – The user to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created user override.
- Return type
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this category.
New in version 1.11.
- Parameters
user (
Member
) – The user whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this category.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
CategoryUserOverride
]
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this category.
New in version 1.11.
- Parameters
user (
Member
) – The user to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
ClientUser¶
- class guilded.ClientUser¶
Represents the current logged-in user.
- property bot¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
Whether the user is a bot account or webhook.
- Type
- property display_avatar¶
The “top-most” avatar for this user, or, the avatar that the client will display in the member list and in chat.
- Type
ChatChannel¶
- class guilded.ChatChannel¶
Represents a chat channel in a
Server
.- await create_webhook(*, name)¶
This function is a coroutine.
Create a webhook in this channel.
- Parameters
name (
str
) – The webhook’s name.- Returns
The created webhook.
- Return type
- Raises
HTTPException – Creating the webhook failed.
Forbidden – You do not have permissions to create a webhook.
- await webhooks()¶
This function is a coroutine.
Fetch the list of webhooks in this channel.
Warning
This endpoint cannot be paginated.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
ChatMessage¶
- class guilded.ChatMessage¶
A message in Guilded.
There is an alias for this class called
Message
.- x == y
Checks if two messages are equal.
- x != y
Checks if two messages are not equal.
- hash(x)
Returns the message’s hash.
- embeds¶
The list of embeds in the message. This does not include link unfurl embeds.
- Type
List[
Embed
]
- attachments¶
The list of media attachments in the message.
- Type
List[
Attachment
]
- channel¶
The channel this message was sent in.
- Type
- private¶
Whether the message was sent so that only server moderators and users mentioned in the message can see it.
- Type
- silent¶
Whether the message was sent silently, i.e., if this is true then users mentioned in the message were not sent a notification.
- Type
URLs in
content
that have been prevented from unfurling as a link preview when displayed in Guilded.- Type
List[
str
]
- created_at¶
When the message was created.
- Type
- updated_at¶
When the message was last updated.
- Type
Optional[
datetime.datetime
]
- deleted_at¶
When the message was deleted.
- Type
Optional[
datetime.datetime
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server this message was sent in.
- Type
Optional[
Server
]
- property author¶
The user that created this message, if they are cached.
The share URL of the message.
- Type
- property jump_url¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
share_url
.The share URL of the message.
- Type
- property replied_to¶
The list of messages that the message replied to.
This property relies on message cache. If you need a list of IDs, consider
replied_to_ids
instead.- Type
List[
ChatMessage
]
- await delete(*, delay=None)¶
This function is a coroutine.
Delete this message.
- Parameters
delay (Optional[
float
]) – If provided, the number of seconds to wait in the background before deleting this message. If the deletion fails, then it is silently ignored.- Raises
Forbidden – You do not have proper permissions to delete this message.
NotFound – This message has already been deleted.
HTTPException – Deleting this message failed.
- await edit(content=..., *, embed=..., embeds=..., hide_preview_urls=...)¶
This function is a coroutine.
Edit this message.
Warning
This method overwrites all content previously in the message using the new payload.
- Parameters
content (
str
) – The text content of the message.embed (
Embed
) – An embed in the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds in the message. At present, this can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
- Returns
The edited message.
- Return type
- Raises
NotFound – The message does not exist.
Forbidden – The message is not owned by you or it is in a channel you cannot access.
HTTPException – Could not edit the message.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this message.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_reaction(emote, member=None)¶
This function is a coroutine.
Remove a reaction from this message.
If the reaction is not your own then
manage_messages
is required.New in version 1.9.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this message.
Deprecated since version 1.9: Use
remove_reaction()
instead.- Parameters
emote (
Emote
) – The emote to remove.
- await clear_reaction(emote, /)¶
This function is a coroutine.
Bulk remove reactions from this message based on their emote.
To remove individual reactions from specific users, see
remove_reaction()
.New in version 1.9.
- Parameters
emote (
Emote
) – The emote to remove.
- await clear_reactions()¶
This function is a coroutine.
Bulk remove all the reactions from this message.
New in version 1.9.
- await reply(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None)¶
This function is a coroutine.
Reply to this message. This is identical to
abc.Messageable.send()
, but thereply_to
parameter already includes this message.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- await create_thread(name, *, visibility=None)¶
This function is a coroutine.
Create a new thread under the message.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
- property raw_user_mentions¶
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property user_mentions¶
The list of users who are mentioned in the content.
- await pin()¶
This function is a coroutine.
Pin this message.
New in version 1.10.
- Raises
NotFound – The channel or message does not exist.
Forbidden – You are not allowed to pin messages in this channel.
HTTPException – Failed to pin the message.
- await unpin()¶
This function is a coroutine.
Unpin this message.
New in version 1.10.
- Raises
NotFound – The channel or message does not exist.
Forbidden – You are not allowed to unpin messages in this channel.
HTTPException – Failed to unpin the message.
Doc¶
- class guilded.Doc¶
Represents a doc in a
DocsChannel
.- x == y
Checks if two docs are equal.
- x != y
Checks if two docs are not equal.
- hash(x)
Returns the hash of the doc.
- str(x)
Returns the title of the doc.
- channel¶
The channel that the doc is in.
- Type
- created_at¶
When the doc was created.
- Type
- updated_at¶
When the doc was last modified.
- Type
Optional[
datetime.datetime
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the doc is in.
- Type
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this doc.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this doc.
- Parameters
emote (
Emote
) – The emote to remove.
- await reply(content)¶
This function is a coroutine.
Reply to this doc.
New in version 1.7.
- Parameters
content (
str
) – The content of the reply.- Returns
The created reply.
- Return type
- Raises
NotFound – This doc does not exist.
Forbidden – You do not have permission to reply to this doc.
HTTPException – Failed to reply to this doc.
- await fetch_reply(reply_id, /)¶
This function is a coroutine.
Fetch a reply to this doc.
New in version 1.7.
- Returns
The reply from the ID.
- Return type
- Raises
NotFound – This reply or doc does not exist.
Forbidden – You do not have permission to read this doc’s replies.
HTTPException – Failed to fetch the reply.
- await fetch_replies()¶
This function is a coroutine.
Fetch all replies to this doc.
New in version 1.7.
- Returns
The replies under the doc.
- Return type
List[
DocReply
]- Raises
NotFound – This doc does not exist.
Forbidden – You do not have permission to read this doc’s replies.
HTTPException – Failed to fetch the replies to this doc.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
DocReply¶
- class guilded.DocReply¶
Represents a reply to a
Doc
.- x == y
Checks if two replies are equal.
- x != y
Checks if two replies are not equal.
- hash(x)
Returns the reply’s hash.
New in version 1.7.
- created_at¶
When the reply was created.
- Type
- updated_at¶
When the reply was last updated.
- Type
Optional[
datetime.datetime
]
- await edit(*, content)¶
This function is a coroutine.
Edit this reply.
- Parameters
content (
str
) – The content of the reply.- Returns
The updated reply.
- Return type
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to update this reply.
HTTPException – Failed to update this reply.
- await delete()¶
This function is a coroutine.
Delete this reply.
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to delete this reply.
HTTPException – Failed to delete this reply.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this reply.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this reply.
- Parameters
emote (
Emote
) – The emote to remove.
- property channel¶
The channel that the reply is in.
- Type
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
DocsChannel¶
- class guilded.DocsChannel¶
Represents a docs channel in a
Server
.- await create_doc(*, title, content)¶
This function is a coroutine.
Create a new doc in this channel.
- await fetch_doc(doc_id, /)¶
This function is a coroutine.
Fetch an doc in this channel.
- Returns
The doc by the ID.
- Return type
- await fetch_docs(*, limit=None, before=None)¶
This function is a coroutine.
Fetch multiple docs in this channel.
All parameters are optional.
- Parameters
limit (
int
) – The maximum number of docs to return. Defaults to 25, can be at most 100.before (
datetime.datetime
) – The latest date that an doc can be from. Defaults to the current time.
- Returns
The docs in the channel.
- Return type
List[
Doc
]
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
Emote¶
- class guilded.Emote¶
Represents a server or stock emote in Guilded.
- x == y
Checks if two emotes are equal.
- x != y
Checks if two emotes are not equal.
- hash(x)
Returns the emote’s hash.
- str(x)
Returns the name of the emote.
Changed in version 1.13: If the official markdown feature is enabled, returns a markdown string for mentioning the emote instead.
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the emote is from, if any.
- Type
Optional[
Server
]
- url_with_format(format)¶
Returns a new URL with a different format. By default, the format will be
apng
if provided, elsewebp
.This is functionally a more restricted version of
Asset.with_format()
; that is, only formats that are available to emotes can be used in an attempt to avoid generating nonfunctional URLs.- Parameters
format (
str
) – The new format to change it to. Must be ‘png’ or ‘webp’ if stock unicode or custom, and ‘png’, ‘webp’, or ‘apng’ if stock Guilded.- Returns
The emote’s newly updated CDN URL.
- Return type
- Raises
InvalidArgument – Invalid format provided.
- url_with_static_format(format)¶
Returns a new URL with a different format if the emote is static, else the current (animated) URL is returned.
This is functionally a more restricted version of
Asset.with_static_format()
; that is, only formats that are available to emotes can be used in an attempt to avoid generating nonfunctional URLs.- Parameters
format (
str
) – The new format to change it to. Must be one of ‘png’ or ‘webp’.- Returns
The emote’s newly updated CDN URL.
- Return type
- Raises
InvalidArgument – Invalid format provided.
File¶
- class guilded.File¶
Wraps files pre- and mid-upload.
- bytes(x)
Returns the bytes of the underlying file.
- Parameters
fp (Union[
os.PathLike
,io.BufferedIOBase
]) – The file to upload. If passing a file withopen
, the file should be opened inrb
mode.filename (Optional[
str
]) – The name of this file.file_type (
FileType
) – The file’s file type. If this could not be detected by the library, defaults toFileType.image
.
- fp¶
The file ready to be uploaded to Guilded.
- Type
Union[
os.PathLike
,io.BufferedIOBase
]
- type¶
The file’s media type. This correlates to what the file is being uploaded for (e.g., an avatar) rather than the type of file that it is (e.g., an image). This will usually be set by the library before uploading.
- Type
Optional[
MediaType
]
- set_media_type(media_type)¶
Manually set this file’s media type.
- set_file_type(file_type)¶
Manually set this file’s file type.
FlowBot¶
ForumChannel¶
- class guilded.ForumChannel¶
Represents a forum channel in a
Server
.- await create_topic(*, title, content)¶
This function is a coroutine.
Create a new topic in this forum.
- Parameters
- Returns
The topic that was created.
- Return type
- await create_thread(*, name, content=None, **kwargs)¶
This function is a coroutine.
This exists for compatibility with discord.py bots. It may be removed in a later version.
Create a new topic in this forum.
- Parameters
- Returns
The topic that was created.
- Return type
- await fetch_topic(topic_id, /)¶
This function is a coroutine.
Fetch a topic from this forum.
- Returns
The topic by its ID.
- Return type
- async for ... in topics(limit=25, before=None)¶
An asynchronous iterator for the events in this channel.
Examples
Usage
async for topic in channel.topics(): print(f"{topic}'s last activity was at {topic.bumped_at or topic.created_at}")
Flattening into a list
topics = [topic async for topic in channel.topics()] # topics is now a list of ForumTopic
- Parameters
limit (Optional[
int
]) – The maximum number of topics to return. Defaults to 25 if not specified.before (Optional[Union[
ForumTopic
,datetime.datetime
]]) – The topic to stop pagination at.
- Yields
ForumTopic
– An topic in this channel.- Raises
Forbidden – You do not have permissions to get topics in this channel.
HTTPException – Failed to get the topics.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
ForumTopic¶
- class guilded.ForumTopic¶
Represents a forum topic.
- x == y
Checks if two topics are equal.
- x != y
Checks if two topics are not equal.
- hash(x)
Returns the hash of the topic.
- str(x)
Returns the title of the topic.
- channel¶
The forum channel that the topic is in.
- Type
- created_at¶
When the topic was created.
- Type
- updated_at¶
When the topic was last updated.
- Type
Optional[
datetime.datetime
]
- bumped_at¶
When the topic was last bumped.
- Type
Optional[
datetime.datetime
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the topic is in.
- Type
The share URL of the topic.
- Type
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this topic.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this topic.
- Parameters
emote (
Emote
) – The emote to remove.
- await edit(*, title=..., content=...)¶
This function is a coroutine.
Edit this topic.
All parameters are optional.
- Parameters
- Returns
The newly edited topic.
- Return type
- await delete()¶
This function is a coroutine.
Delete this topic.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to delete this topic.
HTTPException – Failed to delete this topic.
- await pin()¶
This function is a coroutine.
Pin (sticky) this topic.
New in version 1.4.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to pin this topic.
HTTPException – Failed to pin this topic.
- await sticky()¶
This function is a coroutine.
Pin (sticky) this topic.
New in version 1.4.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to pin this topic.
HTTPException – Failed to pin this topic.
- await unpin()¶
This function is a coroutine.
Unpin (unsticky) this topic.
New in version 1.4.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to unpin this topic.
HTTPException – Failed to unpin this topic.
- await unsticky()¶
This function is a coroutine.
Unpin (unsticky) this topic.
New in version 1.4.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to unpin this topic.
HTTPException – Failed to unpin this topic.
- await lock()¶
This function is a coroutine.
Lock this topic.
New in version 1.4.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to lock this topic.
HTTPException – Failed to lock this topic.
- await unlock()¶
This function is a coroutine.
Unlock this topic.
New in version 1.4.
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to unlock this topic.
HTTPException – Failed to unlock this topic.
- await reply(content)¶
This function is a coroutine.
Reply to this topic.
New in version 1.5.
- Parameters
content (
str
) – The content of the reply.- Returns
The created reply.
- Return type
- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to reply to this topic.
HTTPException – Failed to reply to this topic.
- await fetch_reply(reply_id, /)¶
This function is a coroutine.
Fetch a reply to this topic.
New in version 1.5.
- Returns
The reply from the ID.
- Return type
- Raises
NotFound – This reply or topic does not exist.
Forbidden – You do not have permission to read this topic’s replies.
HTTPException – Failed to fetch the reply.
- await fetch_replies()¶
This function is a coroutine.
Fetch all replies to this topic.
New in version 1.5.
- Returns
The replies under the topic.
- Return type
List[
ForumTopicReply
]- Raises
NotFound – This topic does not exist.
Forbidden – You do not have permission to read this topic’s replies.
HTTPException – Failed to fetch the replies to this topic.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
ForumTopicReply¶
- class guilded.ForumTopicReply¶
Represents a reply to a
ForumTopic
.- x == y
Checks if two replies are equal.
- x != y
Checks if two replies are not equal.
- hash(x)
Returns the reply’s hash.
New in version 1.5.
- parent¶
The topic that the reply is a child of.
- Type
- created_at¶
When the reply was created.
- Type
- updated_at¶
When the reply was last updated.
- Type
Optional[
datetime.datetime
]
- await edit(*, content)¶
This function is a coroutine.
Edit this reply.
- Parameters
content (
str
) – The content of the reply.- Returns
The updated reply.
- Return type
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to update this reply.
HTTPException – Failed to update this reply.
- await delete()¶
This function is a coroutine.
Delete this reply.
- Raises
NotFound – This reply does not exist.
Forbidden – You do not have permission to delete this reply.
HTTPException – Failed to delete this reply.
- await add_reaction(emote, /)¶
This function is a coroutine.
Add a reaction to this reply.
New in version 1.6.
- Parameters
emote (
Emote
) – The emote to add.
- await remove_self_reaction(emote, /)¶
This function is a coroutine.
Remove one of your reactions from this reply.
New in version 1.6.
- Parameters
emote (
Emote
) – The emote to remove.
- property channel¶
The channel that the reply is in.
- Type
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
Group¶
- class guilded.Group¶
Represents a server group in Guilded.
- x == y
Checks if two groups are equal.
- x != y
Checks if two groups are not equal.
- hash(x)
Returns the group’s hash.
- str(x)
Returns the name of the group.
- created_at¶
When the group was created.
- Type
- updated_at¶
When the group was last updated.
- Type
Optional[
datetime.datetime
]
- archived_at¶
When the group was archived, if applicable.
- Type
Optional[
datetime.datetime
]
- property display_avatar¶
The group’s displayed avatar. If
home
isTrue
, this will be theserver
’s avatar instead.- Type
Optional[
Asset
]
- await edit(*, name=..., description=..., emote=..., public=...)¶
This function is a coroutine.
Edit the group.
All parameters are optional.
New in version 1.9.
- Parameters
- Raises
HTTPException – Editing the group failed.
Forbidden – You do not have permissions to edit the group.
- Returns
The newly edited group.
- Return type
- await delete()¶
This function is a coroutine.
Delete the group.
New in version 1.9.
- Raises
HTTPException – Deleting the group failed.
Forbidden – You do not have permissions to delete the group.
- await add_member(member, /)¶
This function is a coroutine.
Add a member to this group.
- Raises
NotFound – This group has been deleted or the member does not exist.
Forbidden – You do not have permission to add the member to this group.
HTTPException – Failed to add the member to this group.
- await remove_member(member, /)¶
This function is a coroutine.
Remove a member from this group.
- Raises
NotFound – This group has been deleted or the member does not exist.
Forbidden – You do not have permission to remove the member from this group.
HTTPException – Failed to remove the member from this group.
Invite¶
- class guilded.Invite¶
Represents an invite that can be used to add members to a
Server
.- x == y
Checks if two invites are equal.
- x != y
Checks if two invites are not equal.
- hash(x)
Returns the invite’s hash.
- str(x)
Returns the URL of the invite.
ListChannel¶
- class guilded.ListChannel¶
Represents a list channel in a
Server
.- await fetch_item(item_id, /)¶
This function is a coroutine.
Fetch an item in this channel.
- Returns
The item by the ID.
- Return type
- await fetch_items()¶
This function is a coroutine.
Fetch all items in this channel.
- Returns
The items in this channel.
- Return type
List[
ListItem
]
- await create_item(message, *, note_content=None)¶
This function is a coroutine.
Create an item in this channel.
- await create_webhook(*, name)¶
This function is a coroutine.
Create a webhook in this channel.
- Parameters
name (
str
) – The webhook’s name.- Returns
The created webhook.
- Return type
- Raises
HTTPException – Creating the webhook failed.
Forbidden – You do not have permissions to create a webhook.
- await webhooks()¶
This function is a coroutine.
Fetch the list of webhooks in this channel.
Warning
This endpoint cannot be paginated.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
ListItem¶
- class guilded.ListItem¶
Represents an item in a
ListChannel
.- x == y
Checks if two items are equal.
- x != y
Checks if two items are not equal.
- hash(x)
Returns the hash of the item.
- created_at¶
When the item was created.
- Type
- note¶
The item’s note.
- Type
- updated_at¶
When the item was last updated.
- Type
Optional[
datetime.datetime
]
- completed_at¶
When the item was marked as completed.
- Type
Optional[
datetime.datetime
]
- property server¶
The server that the item is in.
Chances are that this will only be
None
for partial webhook responses.- Type
Optional[
Server
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the item is in.
- Type
Optional[
Server
]
- property channel¶
The channel that the item is in.
- Type
The share URL of the item.
- Type
- property assigned_to¶
The members that the item is assigned to, designated by the user & role mentions in
message
.- Type
List[
Member
]
- await fetch_parent()¶
This function is a coroutine.
Fetch the item that this item is a child of, if it exists.
- Returns
The item’s parent.
- Return type
- Raises
ValueError – This item has no parent.
- await fetch_note()¶
This function is a coroutine.
Fetch this item’s note. This should only be necessary if you obtained this object through
ListChannel.fetch_items()
.- Returns
This item’s note.
- Return type
- await edit(*, message=..., note_content=...)¶
This function is a coroutine.
Edit this item.
All parameters are optional.
- await complete()¶
This function is a coroutine.
Mark this list item as complete.
If this item has any children, they will also be marked as complete.
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
ListItemNote¶
- class guilded.ListItemNote¶
Represents the note on a
ListItem
.- created_at¶
When the note was created.
- Type
- updated_at¶
When the note was last updated.
- Type
Optional[
datetime.datetime
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that the note’s parent item is in.
- Type
- property channel¶
The channel that the note’s parent item is in.
- Type
- await edit(*, content=...)¶
This function is a coroutine.
Edit this note.
- Parameters
content (
str
) – The text content of the note.- Returns
The newly edited note.
- Return type
- property channel_mentions¶
The list of channels that are mentioned in the content.
- Type
List[
ServerChannel
]
- property mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The list of users who are mentioned in the content.
- property raw_channel_mentions¶
A list of channel IDs for the channels that are mentioned in the content.
This is useful if you need the channels that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_mentions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
A list of user IDs for the users that are mentioned in the content.
This is useful if you need the users that are mentioned but do not care about their resolved data.
- Type
List[
str
]
- property raw_role_mentions¶
A list of role IDs for the roles that are mentioned in the content.
This is useful if you need the roles that are mentioned but do not care about their resolved data.
- Type
List[
int
]
Media¶
- class guilded.Media¶
Represents a media post in a
MediaChannel
.- x == y
Checks if two medias are equal.
- x != y
Checks if two medias are not equal.
- hash(x)
Returns the hash of the media.
- str(x)
Returns the URL of the media.
- len(x)
Returns the length of the media’s URL.
- channel¶
The channel that the media is in.
- Type
- created_at¶
When the media was created.
- Type
MediaChannel¶
- class guilded.MediaChannel¶
Represents a media channel in a
Server
.- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
Member¶
- class guilded.Member¶
Represents a member of a
Server
.- x == y
Checks if two members are equal. Note that this works with
User
instances too.
- x != y
Checks if two members are not equal. Note that this works with
User
instances too.
- hash(x)
Returns the member’s hash.
- str(x)
Returns the member’s name.
- joined_at¶
When the member joined their server. This may be
None
if the member object was partial.- Type
Optional[
datetime.datetime
]
- property id¶
Equivalent to
User.id
- property name¶
Equivalent to
User.name
- property created_at¶
Equivalent to
User.created_at
- property default_avatar¶
Equivalent to
User.default_avatar
- property avatar¶
Equivalent to
User.avatar
- property dm_channel¶
Equivalent to
User.dm_channel
- property banner¶
Equivalent to
User.banner
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.
- property server_permissions¶
The server-level permissions that this member has.
This only considers the permissions immediately granted by the member’s roles and not any channel permission overwrites.
This does take into consideration server ownership.
New in version 1.9.
- Type
- property guild_permissions¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server_permissions
.- Type
- is_owner()¶
bool
: Whether this member is the owner of their server.This may incorrectly be
False
when the member and server are both partial.
- await set_nickname(nickname, /)¶
This function is a coroutine.
Set this member’s nickname. Use
None
to remove their nickname.- Returns
The member’s nickname after the operation.
- Return type
Optional[
str
]- Raises
NotFound – This member does not exist.
Forbidden – You are not allowed to edit this member’s nickname. You can never edit a member who is above you in the role hierarchy.
HTTPException – Failed to set this member’s nickname.
- await edit(*, nick=..., roles=..., xp=..., **kwargs)¶
This function is a coroutine.
Edit this member.
Depending on the parameters provided, this method requires different permissions:
Parameter
Permission
nick
roles
xp
All parameters are optional.
- Parameters
- Raises
NotFound – This member does not exist.
Forbidden – You are not allowed to edit this member. You can never edit a member who is above you in the role hierarchy.
HTTPException – Failed to edit this member.
- await ban(**kwargs)¶
This function is a coroutine.
Ban this member. Equivalent to
Server.ban()
.
- await unban()¶
This function is a coroutine.
Unban this member. Equivalent to
Server.unban()
.
- await kick()¶
This function is a coroutine.
Kick this member. Equivalent to
Server.kick()
.
- await add_role(role)¶
This function is a coroutine.
Add a role to this member.
- Parameters
role (
Role
) – The role to give this member.
- await add_roles(*roles)¶
This function is a coroutine.
This exists for compatibility with discord.py bots. It may be removed in a later version.
Add roles to this member.
- Parameters
roles (List[
Role
]) – The roles to add to the member.
- await remove_role(role)¶
This function is a coroutine.
Remove a role from this member.
- Parameters
role (
Role
) – The role to remove from member.
- await remove_roles(*roles)¶
This function is a coroutine.
This exists for compatibility with discord.py bots. It may be removed in a later version.
Remove roles from this member.
- Parameters
roles (List[
Role
]) – The roles to remove from the member.
- await fetch_role_ids()¶
This function is a coroutine.
Fetch the list of role IDs assigned to this member.
- Returns
The IDs of the roles that the member has.
- Return type
List[
int
]
- await fetch_social_link(social_link_type, /)¶
This function is a coroutine.
Fetch one of this member’s social links.
New in version 1.3.
- Parameters
social_link_type (
SocialLinkType
) – The type of social link to get.- Returns
The member’s social link on the external service.
- Return type
- Raises
TypeError – A
SocialLinkType
was not passed tosocial_link_type
.NotFound – The member does not have social link of the requested type.
HTTPException – Failed to retrieve the social link.
- await award_xp(amount, /)¶
This function is a coroutine.
Award XP to this member.
Note
This method modifies the current value, it does not replace it. To set total XP, use
set_xp()
.
- await set_xp(total, /)¶
This function is a coroutine.
Set this member’s total XP.
Note
This method replaces the current value. To add or subtract XP, use
award_xp()
.New in version 1.3.
- await fetch_permissions()¶
This function is a coroutine.
Fetch this member’s server permissions.
New in version 1.9.1.
- Returns
The permissions that this member has.
- Return type
- Raises
NotFound – The member does not exist.
HTTPException – Failed to fetch the member’s permissions.
- property badges¶
Equivalent to
User.badges
- property bio¶
Equivalent to
User.bio
- property blocked_at¶
Equivalent to
User.blocked_at
- property bot_id¶
Equivalent to
User.bot_id
- property color¶
Equivalent to
User.color
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- property display_avatar¶
Equivalent to
User.display_avatar
- property display_name¶
Equivalent to
User.display_name
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- property games¶
Equivalent to
User.games
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- property mention¶
Equivalent to
User.mention
- property moderation_status¶
Equivalent to
User.moderation_status
- property online_at¶
Equivalent to
User.online_at
- property presence¶
Equivalent to
User.presence
- property profile_url¶
Equivalent to
User.profile_url
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
- property status¶
Equivalent to
User.status
- property stonks¶
Equivalent to
User.stonks
- property subdomain¶
Equivalent to
User.subdomain
- property tagline¶
Equivalent to
User.tagline
- property type¶
Equivalent to
User.type
- property vanity_url¶
Equivalent to
User.vanity_url
MemberBan¶
- class guilded.MemberBan¶
Represents a ban created in a
Server
.- x == y
Checks if two bans are equal.
- x != y
Checks if two bans are not equal.
- created_at¶
When the ban was created.
- Type
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.
- await revoke()¶
This function is a coroutine.
Revoke this ban; unban the user it was created for.
This is equivalent to
Server.unban()
.
Mentions¶
- class guilded.Mentions¶
Represents mentions in Guilded content. This data is determined and sent by Guilded rather than being parsed by the library.
- property channels¶
The list of channels that were mentioned.
An empty list is always returned in a DM context.
- Type
List[
ServerChannel
]
- property roles¶
The list of roles that were mentioned.
An empty list is always returned in a DM context.
- Type
List[
Role
]
- await fill(*, ignore_cache=False, ignore_errors=False)¶
This function is a coroutine.
Fetch & fill the internal cache with the targets referenced.
- Parameters
ignore_cache (
bool
) – Whether to fetch objects even if they are already cached. Defaults toFalse
if not specified.ignore_errors (
bool
) – Whether to ignoreHTTPException
s that occur while fetching. Defaults toFalse
if not specified.
PartialMessageable¶
- class guilded.PartialMessageable¶
Represents a partial messageable to aid with working messageable channels when only a channel ID is present.
The only way to construct this class is through
Client.get_partial_messageable()
.Note that this class is trimmed down and has no rich attributes.
New in version 1.4.
- x == y
Checks if two partial messageables are equal.
- x != y
Checks if two partial messageables are not equal.
- hash(x)
Returns the partial messageable’s hash.
- type¶
The channel type associated with this partial messageable, if given.
- Type
Optional[
ChannelType
]
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server this partial messageable is in.
- Type
Optional[
Server
]
Returns a URL that allows the client to jump to the channel.
- Type
- property created_at¶
Returns the channel’s creation time in UTC.
This function exists for compatibility with other channel types. Since partial messageables cannot determine their creation date from only their UUID, this will always return 1/1/2016.
- Type
Reaction¶
- class guilded.Reaction¶
Represents an emoji reaction on an instance of content (represented by
parent
).- parent¶
The content that the reaction is on.
- Type
- message¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
parent
The content that the reaction is on.
- Type
- user¶
If in the context of a reaction event, this is the user who added or removed the reaction. For most cases,
users()
should be used instead.
- property channel¶
The channel that the reaction is in.
- Type
- await remove_self()¶
This function is a coroutine.
Remove this reaction for yourself.
You cannot remove other users’ reactions.
- async for ... in users(*, limit=None, after=None)¶
An asynchronous iterator for the users that have reacted with this emote to this content.
Results may not be in any expected order.
Examples
Usage
async for user in reaction.users(): print(f'{user} reacted with {reaction.emote}')
Flattening into a list
users = [user async for user in reaction.users()] # users is now a list of User winner = random.choice(users) await channel.send(f'Out of all {reaction.count} entrants, {winner} has won our completely unbiased contest.')
- Parameters
- Yields
Union[
User
,Member
] – The user that created the reaction. This will be aUser
if there is no server or if theMember
is otherwise unavailable.- Raises
HTTPException – Failed to get one or multiple users.
ValueError –
after
is not a valid option.
Role¶
- class guilded.Role¶
Represents a role in a
Server
.- x == y
Checks if two roles are equal.
- x != y
Checks if two roles are not equal.
- hash(x)
Returns the role’s hash.
- str(x)
Returns the name of the role.
- created_at¶
When the role was created.
- Type
Optional[
datetime.datetime
]
- updated_at¶
When the role was last updated.
- Type
Optional[
datetime.datetime
]
- self_assignable¶
Whether members may add themselves to this role without requiring permissions to manage roles.
- Type
- displayed_separately¶
Whether the role is displayed seperately (or “hoisted”) in the member list.
- Type
- bot_user_id¶
The user ID of the bot that the role was created for. If this is present, it means the role cannot be deleted normally or assigned to other members.
- Type
Optional[
str
]
- property mention¶
The mention string for this role.
When sent in an
Embed
, this will render a role mention, but it will not notify anybody.- Type
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this role is from.
- Type
- property colours¶
The colour(s) of the role. If there are two values, the second indicates the end of the gradient.
New in version 1.9.
- Type
List[
Colour
]
- property colors¶
The colour(s) of the role. If there are two values, the second indicates the end of the gradient.
New in version 1.9.
- Type
List[
Colour
]
- property display_icon¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
icon
.The role’s icon asset, if any.
- Type
Optional[
Asset
]
- property hoist¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
displayed_separately
.- Type
- property permissions¶
The permissions that the role has.
- Type
- property position¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
The role’s priority in the role hierarchy. Could be zero or negative.
- Type
- is_default()¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
base
.
- is_assignable()¶
bool
: Whether the bot can give the role to users.Does not account for your permissions.
- await award_xp(amount)¶
This function is a coroutine.
Award XP to all members with this role. Could be a negative value to remove XP.
- Parameters
amount (
int
) – The amount of XP to award.
- await edit(*, name=..., permissions=..., priority=..., colours=..., colors=..., colour=..., color=..., displayed_separately=..., hoist=..., self_assignable=..., mentionable=...)¶
This function is a coroutine.
Update the role.
All parameters are optional.
New in version 1.9.
- Parameters
name (
str
) – The name of the role.permissions (
Permissions
) – The permissions for the role.priority (
int
) –The priority of the role in the role hierarchy. Could be zero or negative.
New in version 1.12.
colours (List[Union[
Colour
,int
]]) – The colour(s) of the role. If there are two values, the second indicates the end of the gradient. This is also aliased tocolors
. This cannot be used withcolour
.colour (Union[
Colour
,int
]) – The primary colour of the role. This is also aliased tocolor
. This cannot be used withcolours
.displayed_separately (
bool
) – Whether the role should be separated in the member list. Defaults toFalse
. This is also aliased tohoist
.self_assignable (
bool
) – Whether members should be allowed to assign the role to themselves. Defaults toFalse
.mentionable (
bool
) – Whether all members should be able to mention the role. Defaults toFalse
.
- Raises
Forbidden – You do not have permissions to update the role.
HTTPException – Updating the role failed.
TypeError – Cannot provide both
colours
andcolour
ordisplayed_separately
andhoist
.
- Returns
The newly updated role.
- Return type
- await delete()¶
This function is a coroutine.
Delete the role.
New in version 1.9.
- Raises
Forbidden – You do not have permissions to delete the role.
HTTPException – Deleting the role failed.
- Returns
The deleted role.
- Return type
SchedulingChannel¶
- class guilded.SchedulingChannel¶
Represents a scheduling channel in a
Server
.- property availabilities¶
The list of availabilities in this channel.
- Type
List[
Availability
]
- get_availability(id)¶
Optional[
Availability
]: Get an availability in this channel.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
Server¶
- class guilded.Server¶
Represents a server (or “guild”) in Guilded.
There is an alias for this class called
Guild
.- x == y
Checks if two servers are equal.
- x != y
Checks if two servers are not equal.
- hash(x)
Returns the server’s hash.
- str(x)
Returns the server’s name.
- type¶
The type of server. This correlates to one of the options in the server settings page under “Server type”.
- Type
Optional[
ServerType
]
- created_at¶
When the server was created.
- Type
- slug¶
The server’s URL slug (or “vanity code”). Referred to as a “Server URL” in the client. For a complete URL, see
vanity_url
.- Type
Optional[
str
]
- property description¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
about
.The server’s description.
- Type
- property timezone¶
The server’s timezone.
If you are using Python 3.9 or greater, this is an instance of ZoneInfo. Otherwise, if pytz is available in the working environment, an instance from pytz. If neither apply or the server does not have a timezone set, this will be
None
.- Type
Optional[
datetime.tzinfo
]
- property member_count¶
The server’s count of all members. If this is
0
, the member cache is empty. It can be populated withfill_members()
.- Type
- property user_member_count¶
The server’s count of non-bot members. If it is above
1000
, this may be an outdated number, provided by Guilded. Otherwise, it should be a precise figure given the data available.New in version 1.12.
- Type
- property channels¶
The list of channels in the server.
- Type
List[
ServerChannel
]
- property announcement_channels¶
The list of announcement channels in the server.
- Type
List[
AnnouncementChannel
]
- property chat_channels¶
The list of chat channels in the server.
- Type
List[
ChatChannel
]
- property docs_channels¶
The list of docs channels in the server.
- Type
List[
DocsChannel
]
- property forum_channels¶
The list of forum channels in the server.
- Type
List[
ForumChannel
]
- property forums¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
forum_channels
.The list of forum channels in the server.
- Type
List[
ForumChannel
]
- property media_channels¶
The list of media channels in the server.
- Type
List[
MediaChannel
]
- property list_channels¶
The list of list channels in the server.
- Type
List[
ListChannel
]
- property scheduling_channels¶
The list of scheduling channels in the server.
- Type
List[
SchedulingChannel
]
- property text_channels¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
chat_channels
.The list of chat channels in the server.
- Type
List[
ChatChannel
]
- property voice_channels¶
The list of voice channels in the server.
- Type
List[
VoiceChannel
]
- property icon¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
avatar
.The server’s set avatar, if any.
- Type
Optional[
Asset
]
- property default_channel¶
The default channel of the server.
It may be preferable to use
fetch_default_channel()
instead of this property, as it relies solely on cache which may not be present for newly joined servers.- Type
Optional[
ServerChannel
]
- get_channel(channel_id, /)¶
Optional[
ServerChannel
]: Get a channel by its ID from the cache.
- get_channel_or_thread(id)¶
Optional[Union[
ServerChannel
,Thread
]]: Get a channel or thread by its ID from the cache.
- await create_category(name, *, group=None)¶
This function is a coroutine.
Create a new category in the server.
New in version 1.11.
- await create_category_channel(name, *, group=None)¶
This function is a coroutine.
Create a new category in the server.
New in version 1.11.
- await create_announcement_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new announcement channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_chat_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new chat channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_text_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
This exists for compatibility with discord.py bots. It may be removed in a later version.
Create a new chat channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_docs_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new docs channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_forum_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new forum channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_forum(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
This exists for compatibility with discord.py bots. It may be removed in a later version.
Create a new forum channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_media_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new media channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_list_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new list channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_scheduling_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new scheduling channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await create_voice_channel(name, *, topic=None, visibility=None, public=None, category=None, group=None)¶
This function is a coroutine.
Create a new voice channel in the server.
- Parameters
name (
str
) – The channel’s name. Can include spaces.topic (
str
) – The channel’s topic.category (
Category
) – TheCategory
to create this channel under. If not provided, it will be shown under the “Channels” header in the client (no category).visibility (
ChannelVisibility
) –What users can access the channel. Currently, this can only be
public
orNone
.New in version 1.10.
public (
bool
) –Whether this channel and its contents should be visible to people who aren’t part of the server. Defaults to
False
.Deprecated since version 1.10: Use
visibility
instead.group (
Group
) – TheGroup
to create this channel in. If not provided, defaults to the base group.
- Returns
The created channel.
- Return type
- await fetch_category(category_id, /)¶
This function is a coroutine.
Fetch a category.
New in version 1.11.
- Returns
The category from the ID.
- Return type
- Raises
HTTPException – Retrieving the category failed.
NotFound – The category to fetch does not exist.
Forbidden – You do not have permission to fetch this category.
- await fetch_channel(channel_id, /)¶
This function is a coroutine.
Fetch a channel.
This method is an API call. For general usage, consider
get_channel()
instead.- Returns
The channel from the ID.
- Return type
- Raises
InvalidData – The target channel does not belong to the current server.
HTTPException – Retrieving the channel failed.
NotFound – The channel to fetch does not exist.
Forbidden – You do not have permission to fetch this channel.
- await fetch_members()¶
This function is a coroutine.
Fetch the list of
Member
s in the server.- Returns
The members in the server.
- Return type
List[
Member
]
- await fetch_member(user_id, /)¶
This function is a coroutine.
Fetch a specific
Member
in this server.
- await fill_members()¶
Fill the member cache for this server.
Note
This is used internally and is generally not needed for most applications as member cache is created and discarded automatically throughout a connected client’s lifetime.
This method could be seen as analogous to guild chunking, except that it uses HTTP and not the gateway.
- await bulk_award_member_xp(amount, *members)¶
This function is a coroutine.
Bulk award XP to multiple members.
Note
This method modifies the current values. To bulk set total XP, use
bulk_set_member_xp()
.New in version 1.11.
- await bulk_set_member_xp(total, *members)¶
This function is a coroutine.
Bulk set multiple members’ total XP.
Note
This method replaces the current values. To add or subtract XP, use
bulk_award_member_xp()
.New in version 1.11.
- await create_role(*, name=..., permissions=..., colours=..., colors=..., colour=..., color=..., displayed_separately=..., hoist=..., self_assignable=..., mentionable=...)¶
This function is a coroutine.
Create a role in the server.
All parameters are optional.
New in version 1.9.
- Parameters
name (
str
) – The name of the role. Defaults to ‘New role’.permissions (
Permissions
) – The permissions for the role.colours (List[Union[
Colour
,int
]]) – The colour(s) of the role. If there are two values, the second indicates the end of the gradient. This is also aliased tocolors
. This cannot be used withcolour
.colour (Union[
Colour
,int
]) – The primary colour of the role. This is also aliased tocolor
. This cannot be used withcolours
.displayed_separately (
bool
) – Whether the role should be separated in the member list. Defaults toFalse
. This is also aliased tohoist
.self_assignable (
bool
) – Whether members should be allowed to assign the role to themselves. Defaults toFalse
.mentionable (
bool
) – Whether all members should be able to mention the role. Defaults toFalse
.
- Raises
Forbidden – You do not have permissions to create a role.
HTTPException – Creating the role failed.
TypeError – Cannot provide both
colours
andcolour
ordisplayed_separately
andhoist
.
- Returns
The created role.
- Return type
- await fetch_roles()¶
This function is a coroutine.
Fetch the list of
Role
s in the server.New in version 1.9.
- Returns
The roles in the server.
- Return type
List[
Role
]
- await fetch_role(role_id, /)¶
This function is a coroutine.
Fetch a specific
Role
in this server.New in version 1.9.
- await fill_roles()¶
Fill the role cache for this server.
New in version 1.9.
- await unban(user)¶
This function is a coroutine.
Unban a user from the server.
- Parameters
user (
abc.User
) – The user to unban.
- await fetch_ban(user)¶
This function is a coroutine.
Fetch a user’s ban.
New in version 1.10.
- Returns
The ban for the user.
- Return type
- await bans()¶
This function is a coroutine.
Get all bans that have been created in the server.
- Returns
The list of bans in the server.
- Return type
List[
MemberBan
]
- await kick(user)¶
This function is a coroutine.
Kick a user from the server.
- Parameters
user (
abc.User
) – The user to kick.
- await create_webhook(name, *, channel)¶
This function is a coroutine.
Create a webhook in a channel.
- Parameters
name (
str
) – The webhook’s name.channel (Union[
ChatChannel
,ListChannel
]) – The channel to create the webhook in.
- Raises
HTTPException – Creating the webhook failed.
Forbidden – You do not have permissions to create a webhook.
- Returns
The created webhook.
- Return type
- await fetch_webhook(webhook_id, /)¶
This function is a coroutine.
Fetch a webhook in this server.
New in version 1.4.
- await webhooks(*, channel=None)¶
This function is a coroutine.
Fetch the list of webhooks in this server.
Changed in version 1.12.1: No longer relies on channel cache when
channel
is not provided.- Parameters
channel (Optional[Union[
ChatChannel
,ListChannel
]]) – The channel to fetch webhooks from.- Returns
The webhooks in this server or, if specified, the channel.
- Return type
List[
Webhook
]- Raises
Forbidden – You do not have permission to get webhooks in this channel.
- await fetch_default_channel()¶
This function is a coroutine.
Fetch the default channel in this server.
- Returns
The default channel.
- Return type
- Raises
ValueError – This server has no default channel.
- await create_group(name, *, description=..., emote=..., public=...)¶
This function is a coroutine.
Create a group in the server.
- Parameters
- Raises
HTTPException – Creating the group failed.
Forbidden – You do not have permissions to create a group.
- Returns
The created group.
- Return type
- await fetch_group(group_id, /)¶
This function is a coroutine.
Fetch a group in the server.
- Raises
HTTPException – Fetching the group failed.
Forbidden – You do not have permissions to fetch the group.
- Returns
The group by the ID.
- Return type
- await fetch_groups()¶
This function is a coroutine.
Fetch all groups in the server.
- Raises
HTTPException – Fetching the groups failed.
Forbidden – You do not have permissions to fetch the groups.
- Returns
The groups in the server.
- Return type
List[
Group
]
- await fetch_subscription_tier(tier_type, /)¶
This function is a coroutine.
Fetch a subscription tier in the server.
New in version 1.9.
- Parameters
tier_type (
ServerSubscriptionTierType
) – The type of the tier to fetch.- Raises
NotFound – The server has no tier with the provided type.
HTTPException – Fetching the tier failed.
- Returns
The subscription tier by the type.
- Return type
- await fetch_subscription_tiers()¶
This function is a coroutine.
Fetch all subscription tiers in the server.
New in version 1.9.
- Raises
HTTPException – Fetching the tiers failed.
- Returns
The subscription tiers in the server.
- Return type
List[
ServerSubscriptionTier
]
ServerSubscriptionTier¶
StreamChannel¶
- class guilded.StreamChannel¶
Represents a stream channel in a
Server
.- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
Thread¶
- class guilded.Thread¶
Represents a thread in a
Server
.- starter_message_id¶
The ID of the message that the thread was created from, if any.
New in version 1.9.
- Type
Optional[
str
]
- property root¶
Optional[
ChatChannel
|VoiceChannel
|StreamChannel
]: The topmost channel in the thread chainNew in version 1.9.
- property parent¶
Optional[
ChatChannel
|VoiceChannel
|StreamChannel
|Thread
]: The parent channel or thread that the thread belongs to
- property starter_message¶
The starter message in the thread, if it exists and is cached.
New in version 1.9.
- Type
Optional[
ChatMessage
]
- await fetch_starter_message()¶
This function is a coroutine.
Fetch the starter message in this thread. Sometimes this may be available via
starter_message
, but it is unlikely when dealing with existing threads because it relies on message cache.This is roughly equivalent to:
initial_message = await thread.fetch_message(thread.starter_message_id)
New in version 1.9.
- Returns
The initial message in the thread, if any.
- Return type
Optional[
ChatMessage
]- Raises
NotFound – The starter message was deleted.
- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
User¶
- class guilded.User¶
Represents a user in Guilded.
- x == y
Checks if two users are equal.
- x != y
Checks if two users are not equal.
- hash(x)
Returns the user’s hash.
- str(x)
Returns the user’s name.
- property bot¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
Whether the user is a bot account or webhook.
- Type
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- property display_avatar¶
The “top-most” avatar for this user, or, the avatar that the client will display in the member list and in chat.
- Type
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- property mention¶
The mention string for this user.
This will render and deliver a mention when sent in an
Embed
.- Type
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
VoiceChannel¶
- class guilded.VoiceChannel¶
Represents a voice channel in a
Server
.- await create_role_override(role, override)¶
This function is a coroutine.
Create a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await create_thread(name, *, message=None, visibility=None)¶
This function is a coroutine.
Create a new thread in the channel.
Warning
Be careful with this method! It is very easy to accidentally cause a loop if you create a thread on a message that caused the creation of its thread.
Depending on the type of the parent channel, this method requires different permissions:
Parent Type
Permission
New in version 1.9.
- Parameters
name (
str
) – The thread’s name. Can include spaces.message (Optional[
ChatMessage
]) – The message to create the thread with. If a private message is passed (i.e.ChatMessage.private
isTrue
), then the thread is private too.visibility (Optional[
ChannelVisibility
]) –What users can access the channel. Currently, this can only be
private
orNone
.New in version 1.10.
- Returns
The created thread.
- Return type
- Raises
NotFound – The server, channel, or message provided does not exist.
Forbidden – You are not allowed to create a thread in this channel.
HTTPException – Failed to create a thread.
- await create_user_override(user, override)¶
This function is a coroutine.
Create a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to create an override for.override (
PermissionOverride
) – The override values to use.
- Returns
The created role override.
- Return type
- await delete_role_override(role)¶
This function is a coroutine.
Delete a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to delete.
- await delete_user_override(user)¶
This function is a coroutine.
Delete a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to delete.
- await edit(*, name=..., topic=..., visibility=..., public=None)¶
This function is a coroutine.
Edit this channel.
All parameters are optional.
- Parameters
name (
str
) – The channel’s name.topic (
str
) – The channel’s topic. Not applicable to threads.visibility (
ChannelVisibility
) – What users can access the channel. A channel cannot currently be manually set toprivate
. Could beNone
to reset the visibility.public (
bool
) –Whether the channel should be public, i.e., visible to users who are not a member of the server. Not applicable to threads.
Deprecated since version 1.10: Use
visibility
instead.
- Returns
The newly edited channel.
- Return type
- await fetch_message(message_id, /)¶
This function is a coroutine.
Fetch a message.
- Returns
The message from the ID.
- Return type
- await fetch_role_override(role)¶
This function is a coroutine.
Fetch a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role whose override to fetch.- Returns
The role override.
- Return type
- await fetch_role_overrides()¶
This function is a coroutine.
Fetch all role-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelRoleOverride
]
- await fetch_user_override(user)¶
This function is a coroutine.
Fetch a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member whose override to fetch.- Returns
The role override.
- Return type
- await fetch_user_overrides()¶
This function is a coroutine.
Fetch all user-based permission overrides in this channel.
New in version 1.11.
- Returns
The role overrides.
- Return type
List[
ChannelUserOverride
]
- property guild¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
server
.The server that this channel is in.
- Type
- await history(*, before=None, after=None, limit=50, include_private=False)¶
This function is a coroutine.
Fetch the message history of this channel.
All parameters are optional.
- Parameters
before (
datetime.datetime
) – Fetch messages sent before this timestamp.after (
datetime.datetime
) – Fetch messages sent after this timestamp.limit (
int
) – The maximum number of messages to fetch. Defaults to 50.include_private (
bool
) – Whether to include private messages in the response. Defaults toFalse
. If the client is a user account, this has no effect and is alwaysTrue
.
- Return type
List[
ChatMessage
]
- is_nsfw()¶
bool
: This exists for compatibility with discord.py bots. It may be removed in a later version.Always returns
False
.New in version 1.11.
- property public¶
Whether the channel is visible to everyone, including members who are not part of the server.
Deprecated since version 1.10: Use
visibility
instead.- Type
- await restore()¶
This function is a coroutine.
Restore this channel from its archived state.
New in version 1.10.
- await send(content=..., *, embed=..., embeds=..., reference=..., reply_to=..., mention_author=None, silent=None, private=False, delete_after=None, hide_preview_urls=...)¶
This function is a coroutine.
Send a message to a Guilded channel.
Warning
Replying with both
silent
andprivate
set toTrue
(a private reply with no mention) will not send the reply to the author of the message(s) until they refresh the channel. This is a Guilded bug.- Parameters
content (
str
) – The text content to send with the message.embed (
Embed
) – An embed to send with the message. This parameter cannot be meaningfully combined withembeds
.embeds (List[
Embed
]) – A list of embeds to send with the message. This can contain at most 1 value. This parameter cannot be meaningfully combined withembed
.reply_to (List[
ChatMessage
]) – A list of up to 5 messages to reply to.silent (
bool
) – Whether this message should not mention the members mentioned in it, including the authors of messages it is in reply to, if any. Defaults toFalse
.private (
bool
) – Whether this message should only be visible to its author (the bot) and the authors of the messages it is replying to. Defaults toFalse
. You should not include sensitive data in these because private replies can still be visible to server moderators.delete_after (
float
) – If provided, the number of seconds to wait in the background before deleting the sent message. If the deletion fails, then it is silently ignored.hide_preview_urls (List[
str
]) – URLs incontent
to prevent unfurling as a link preview when displaying in Guilded.
The share URL of the channel.
- Type
- await update_role_override(role, override)¶
This function is a coroutine.
Update a role-based permission override in this channel.
New in version 1.11.
- Parameters
role (
Role
) – The role to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
- await update_user_override(user, override)¶
This function is a coroutine.
Update a user-based permission override in this channel.
New in version 1.11.
- Parameters
user (
Member
) – The member to update an override for.override (
PermissionOverride
) – The new override values to use.
- Returns
The updated role override.
- Return type
Data Classes¶
Below are some classes that primarily just wrap data. You are able to create most of these yourself.
ChannelRoleOverride¶
- class guilded.ChannelRoleOverride¶
Represents a role-based permission override in a channel.
New in version 1.11.
- override¶
The permission values overridden for the role.
- Type
- channel¶
The channel that the override is in.
- Type
Optional[
abc.ServerChannel
]
- created_at¶
When the override was created.
- Type
- updated_at¶
When the override was last updated.
- Type
Optional[
datetime.datetime
]
ChannelUserOverride¶
- class guilded.ChannelUserOverride¶
Represents a user-based permission override in a channel.
New in version 1.11.
- override¶
The permission values overridden for the user.
- Type
- channel¶
The channel that the override is in.
- Type
Optional[
abc.ServerChannel
]
- created_at¶
When the override was created.
- Type
- updated_at¶
When the override was last updated.
- Type
Optional[
datetime.datetime
]
CategoryRoleOverride¶
- class guilded.CategoryRoleOverride¶
Represents a role-based permission override in a category.
New in version 1.11.
- override¶
The permission values overridden for the role.
- Type
- created_at¶
When the override was created.
- Type
- updated_at¶
When the override was last updated.
- Type
Optional[
datetime.datetime
]
CategoryUserOverride¶
- class guilded.CategoryUserOverride¶
Represents a user-based permission override in a category.
New in version 1.11.
- override¶
The permission values overridden for the user.
- Type
- created_at¶
When the override was created.
- Type
- updated_at¶
When the override was last updated.
- Type
Optional[
datetime.datetime
]
ClientFeatures¶
- class guilded.ClientFeatures¶
Opt-in or out of Guilded or guilded.py features.
All parameters are optional.
Embed¶
- class guilded.Embed¶
Represents a Guilded chat embed.
- len(x)
Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.
Certain properties return an
EmbedProxy
, a type that acts similar to a regulardict
except using dotted access, e.g.embed.author.icon_url
. If the attribute is invalid or empty, then a special sentinel value is returned,Embed.Empty
.URL parameters (both as text and for images) accept any string, even those that are not a valid URI.
For ease of use, all parameters that expect a
str
are implicitly casted tostr
for you.- timestamp¶
The timestamp of the embed content. This could be a naive or aware datetime.
- Type
- colour¶
The colour code of the embed. Aliased to
color
as well. This can be set during initialisation.
- Empty¶
A special sentinel value used by
EmbedProxy
and this class to denote that the value or attribute is empty.
- classmethod from_dict(data)¶
Converts a
dict
to aEmbed
, provided it is in the format that Guilded expects it to be in.This format is identical to Discord’s format.
- Parameters
data (
dict
) – The dictionary to convert into an embed.
- copy()¶
Returns a shallow copy of the embed.
Returns an
EmbedProxy
denoting the footer contents. Seeset_footer()
for possible values you can access. If the attribute has no value thenEmpty
is returned.- Type
Union[
EmbedProxy
,Empty
]
Sets the footer for the embed content. This function returns the class instance to allow for fluent-style chaining.
- property image¶
Returns an
EmbedProxy
denoting the image contents. Possible attributes you can access are:url
proxy_url
width
height
If the attribute has no value then
Empty
is returned.- Type
Union[
EmbedProxy
,Empty
]
- set_image(*, url)¶
Sets the image for the embed content. This function returns the class instance to allow for fluent-style chaining.
- Parameters
url (
str
) – The source URL for the image.
- property thumbnail¶
Returns an
EmbedProxy
denoting the thumbnail contents. Possible attributes you can access are:url
proxy_url
width
height
If the attribute has no value then
Empty
is returned.- Type
Union[
EmbedProxy
,Empty
]
- set_thumbnail(*, url)¶
Sets the thumbnail for the embed content. This function returns the class instance to allow for fluent-style chaining.
- Parameters
url (
str
) – The source URL for the thumbnail.
- property video¶
Returns an
EmbedProxy
denoting the video contents. Possible attributes include:url
for the video URL.height
for the video height.width
for the video width.
If the attribute has no value then
Empty
is returned.- Type
Union[
EmbedProxy
,Empty
]
- property provider¶
Returns an
EmbedProxy
denoting the provider contents. The only attributes that might be accessed arename
andurl
. If the attribute has no value thenEmpty
is returned.- Type
Union[
EmbedProxy
,Empty
]
- property author¶
Returns an
EmbedProxy
denoting the author contents. Seeset_author()
for possible values you can access. If the attribute has no value thenEmpty
is returned.- Type
Union[
EmbedProxy
,Empty
]
- set_author(*, name, url=Embed.Empty, icon_url=Embed.Empty)¶
Sets the author for the embed content. This function returns the class instance to allow for fluent-style chaining.
- remove_author()¶
Clears embed’s author information. This function returns the class instance to allow for fluent-style chaining.
- property fields¶
Returns a
list
ofEmbedProxy
denoting the field contents. Seeadd_field()
for possible values you can access. If the attribute has no value thenEmpty
is returned.- Type
Union[List[
EmbedProxy
],Empty
]
- add_field(*, name, value, inline=True)¶
Adds a field to the embed object. This function returns the class instance to allow for fluent-style chaining.
- insert_field_at(index, *, name, value, inline=True)¶
Inserts a field before a specified index to the embed. This function returns the class instance to allow for fluent-style chaining.
- clear_fields()¶
Removes all fields from this embed.
- remove_field(index)¶
Removes a field at a specified index. If the index is invalid or out of bounds then the error is silently swallowed.
Note
When deleting a field by index, the index of the other fields shift to fill the gap just like a regular list.
- Parameters
index (
int
) – The index of the field to remove.
- set_field_at(index, *, name, value, inline=True)¶
Modifies a field to the embed object. The index must point to a valid pre-existing field. This function returns the class instance to allow for fluent-style chaining.
- Parameters
- Raises
IndexError – An invalid index was provided.
- to_dict()¶
Converts this embed object into a dict.
The resulting format is identical to Discord’s format.
Colour¶
- class guilded.Colour¶
Represents a colour in Guilded, such as in embeds or roles. This class is similar to a (red, green, blue)
tuple
.There is an alias for this class called Color.
- x == y
Checks if two colours are equal.
- x != y
Checks if two colours are not equal.
- hash(x)
Return the colour’s hash.
- str(x)
Returns the hex format for the colour.
- classmethod from_str(value)¶
Constructs a
Colour
from a string.The following formats are accepted:
0x<hex>
#<hex>
0x#<hex>
rgb(<number>, <number>, <number>)
Like CSS,
<number>
can be either 0-255 or 0-100% and<hex>
can be either a 6 digit hex number or a 3 digit hex shortcut (e.g. #fff).- Raises
ValueError – The string could not be converted into a colour.
- classmethod random(*, seed=None)¶
A factory method that returns a
Colour
with a random hue.Note
The random algorithm works by choosing a colour with a random hue but with maxed out saturation and value.
- classmethod dark_theme()¶
A factory method that returns a
Colour
with a value of0x373943
. This will appear transparent in chat.
Object¶
- class guilded.Object¶
Represents a generic Guilded object.
This class is especially useful when interfacing with the early access bot API, in which often only an object’s ID is available.
Warning
Because Guilded IDs are not meaningful in the way that snowflakes are, a creation date is impossible to attain from only an ID. As a result,
created_at
will always return 1/1/2016 for backwards compatibility with applications that implementdiscord.Object.created_at
.- x == y
Checks if two objects are equal.
- x != y
Checks if two objects are not equal.
- hash(x)
Returns the object’s hash.
- created_at¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
Always returns 1/1/2016.
- Type
Permissions¶
- class guilded.Permissions¶
Wraps up permission values in Guilded.
An instance of this class is constructed by providing a list of permission values:
# A `Permissions` instance representing the ability # to read and send messages. guilded.Permissions('CanReadChats', 'CanCreateChats')
- x == y
Checks if two permissions are equal.
- x != y
Checks if two permissions are not equal.
- values¶
The raw array of permission values. This list is not guaranteed to be in any particular order. You should use the properties available on this class instead of this attribute.
- Type
List[
str
]
- classmethod all()¶
A factory method that creates a
Permissions
with all permissions set toTrue
.
- classmethod none()¶
A factory method that creates a
Permissions
with all permissions set toFalse
.
- classmethod general()¶
A factory method that creates a
Permissions
with all “General” permissions set toTrue
.
- classmethod recruitment()¶
A factory method that creates a
Permissions
with all “Recruitment” permissions set toTrue
.
- classmethod announcements()¶
A factory method that creates a
Permissions
with all “Announcement” permissions set toTrue
.
- classmethod chat()¶
A factory method that creates a
Permissions
with all “Chat” permissions set toTrue
.
- classmethod calendar()¶
A factory method that creates a
Permissions
with all “Calendar” permissions set toTrue
.
- classmethod forums()¶
A factory method that creates a
Permissions
with all “Forum” permissions set toTrue
.
- classmethod docs()¶
A factory method that creates a
Permissions
with all “Docs” permissions set toTrue
.
- classmethod media()¶
A factory method that creates a
Permissions
with all “Media” permissions set toTrue
.
- classmethod voice()¶
A factory method that creates a
Permissions
with all “Voice” permissions set toTrue
.
- classmethod competitive()¶
A factory method that creates a
Permissions
with all “Competitive” permissions set toTrue
.
- classmethod customization()¶
A factory method that creates a
Permissions
with all “Customization” permissions set toTrue
.
- classmethod customisation()¶
A factory method that creates a
Permissions
with all “Customization” permissions set toTrue
.
- classmethod forms()¶
A factory method that creates a
Permissions
with all “Forms” permissions set toTrue
.
- classmethod lists()¶
A factory method that creates a
Permissions
with all “List” permissions set toTrue
.
- classmethod brackets()¶
A factory method that creates a
Permissions
with all “Bracket” permissions set toTrue
.
- classmethod scheduling()¶
A factory method that creates a
Permissions
with all “Scheduling” permissions set toTrue
.
- classmethod bots()¶
A factory method that creates a
Permissions
with all “Bot” permissions set toTrue
.
- classmethod xp()¶
A factory method that creates a
Permissions
with all “XP” permissions set toTrue
.
- classmethod streams()¶
A factory method that creates a
Permissions
with all “Stream” permissions set toTrue
.
- classmethod socket_events()¶
A factory method that creates a
Permissions
with all “Socket event” permissions set toTrue
.
- property administrator¶
Returns
True
if a user has every permission.This is a pseudo-permission, i.e., there is no real “administrator” permission, and thus this property being
True
does not necessarily mean that a user will have all the same abilities as a Discord user with the administrator permission.- Type
- property manage_server¶
This is an alias of
update_server
.- Type
- property manage_guild¶
This is an alias of
update_server
.- Type
- property invite_members¶
Returns
True
if a user can directly invite members to the server.- Type
- property create_instant_invite¶
This is an alias of
invite_members
.- Type
- property ban_members¶
This is an alias of
kick_members
.- Type
- property moderator_view¶
Returns
True
if a user can access “moderator view” to see private replies.- Type
- property approve_applications¶
Returns
True
if a user can approve server and game applications.- Type
- property edit_application_form¶
Returns
True
if a user can edit server and game applications, and toggle accepting applications.- Type
- property indicate_lfm_interest¶
Returns
True
if a user can indicate interest in a player instead of an upvote.- Type
- property modify_lfm_status¶
Returns
True
if a user can modify the “Find Player” status for the server listing card.- Type
- property create_announcements¶
Returns
True
if a user can create and delete announcements.- Type
- property manage_announcements¶
Returns
True
if a user can delete announcements by other members or pin any announcement.- Type
- property view_channel¶
This is an alias of
read_messages
.- Type
- property upload_media¶
Returns
True
if a user can upload images and videos to chat messages.- Type
- property create_public_threads¶
This is an alias of
create_threads
.- Type
- property create_private_threads¶
This is an alias of
create_threads
.- Type
- property manage_messages¶
Returns
True
if a user can delete messages by other members or pin any message.- Type
- property manage_events¶
Returns
True
if a user can update calendar events created by other members and move them to other channels.- Type
- property remove_events¶
Returns
True
if a user can remove calendar events created by other members.- Type
- property edit_rsvps¶
Returns
True
if a user can edit the RSVP status for members in a calendar event.- Type
- property manage_topics¶
Returns
True
if a user can remove forum topics and replies created by other members, or move them to other channels.- Type
- property manage_docs¶
Returns
True
if a user can update docs created by other members and move them to other channels.- Type
- property manage_media¶
Returns
True
if a user can update media created by other members and move them to other channels.- Type
- property manage_voice_rooms¶
Returns
True
if a user can create, rename, and delete voice rooms.- Type
- property disconnect_members¶
Returns
True
if a user can disconnect members from voice or stream rooms.- Type
- property broadcast¶
Returns
True
if a user can broadcast their voice to voice rooms lower in the hierarchy when speaking in voice chat.- Type
- property priority_speaker¶
Returns
True
if a user can prioritize their voice when speaking in voice chat.- Type
- property use_voice_activity¶
Returns
True
if a user can use the voice activity input mode for voice chats.- Type
- property use_voice_activation¶
This is an alias of
use_voice_activity
.- Type
- property send_voice_messages¶
Returns
True
if a user can send chat messages to voice channels.- Type
- property manage_tournaments¶
This is an alias of
create_tournaments
.- Type
- property register_for_tournaments¶
Returns
True
if a user can register the server for tournaments.- Type
- property manage_emotes¶
This is an alias of
manage_emojis
- Type
- property manage_nicknames¶
Returns
True
if a user can change the nicknames of other members.- Type
- property view_poll_results¶
This is an alias of
view_poll_responses
.- Type
- property read_list_items¶
This is an alias of
view_list_items
.- Type
- property manage_list_items¶
Returns
True
if a user can update list items created by other members and move them to other channels.- Type
- property remove_list_items¶
Returns
True
if a user can remove list items created by other members.- Type
- property complete_list_items¶
Returns
True
if a user can complete list items created by other members.- Type
- property read_brackets¶
This is an alias of
view_brackets
.- Type
- property report_scores¶
Returns
True
if a user can report match scores on behalf of the server.- Type
- property read_schedules¶
This is an alias of
view_schedules
.- Type
- property create_schedules¶
Returns
True
if a user can let the server know their available schedule.- Type
- property remove_schedules¶
Returns
True
if a user can remove availabilities created by other members.- Type
- property add_stream¶
Returns
True
if a user can stream as well as speak in stream channels.- Type
- property stream¶
This is an alias of
add_stream
.- Type
- property send_stream_messages¶
Returns
True
if a user can send messages in stream channels.- Type
- property use_stream_voice_activity¶
Returns
True
if a user can use voice activity in stream channels.- Type
PermissionOverride¶
- class guilded.PermissionOverride¶
Represents a role permission override
Unlike a regular
Permissions
, the default value of a permission is equivalent toNone
and notFalse
. Setting a value toFalse
is explicitly denying that permission, while setting a value toTrue
is explicitly allowing that permission.The values supported by this are the same as
Permissions
with the added possibility of it being set toNone
.- x == y
Checks if two overrides are equal.
- x != y
Checks if two overrides are not equal.
- iter(x)
Returns an iterator of
(perm, value)
pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown.
- Parameters
**kwargs – Set the value of permissions by their name.
- pair()¶
Tuple[
Permissions
,Permissions
]: Returns the (allow, deny) pair from this override.
- classmethod from_pair(allow, deny)¶
Creates an override from an allow/deny pair of
Permissions
.
- is_empty()¶
Checks if the permission override is currently empty.
An empty permission override is one that has no overrides set to
True
orFalse
.- Returns
Indicates if the override is empty.
- Return type
- update(**kwargs)¶
Bulk updates this permission override object.
Allows you to set multiple attributes by using keyword arguments. The names must be equivalent to the properties listed. Extraneous key/value pairs will be silently ignored.
- Parameters
**kwargs – A list of key/value pairs to bulk update with.
RawReactionActionEvent¶
- class guilded.RawReactionActionEvent¶
Represents the payload for a raw reaction add/remove event.
- message_id¶
This exists for compatibility with discord.py bots. It may be removed in a later version.
This is an alias of
parent_id
.
RepeatInfo¶
- class guilded.RepeatInfo¶
Represents simplified repeat info for a calendar event.
New in version 1.7.
- type¶
The type of interval for the repeating event. Custom intervals are able to specify additional details. Otherwise, the event will repeat for 180 days.
- Type
Union[
RepeatInterval
,CustomRepeatInterval
]
- interval_count¶
How often the event should repeat between the interval. E.g., A value of
1
with atype
ofCustomRepeatInterval.daily
would be once per day, and a value of2
with atype
ofCustomRepeatInterval.daily
would be once per two days. Defaults to1
if applicable and not specified.- Type
Optional[
int
]
- end_after_count¶
The maximum number of repeats for the event. If used with
end_at
, the earliest end date of the two is used.- Type
Optional[
int
]
- end_at¶
The timestamp at which the event should stop repeating. If used with
end_after_count
, the earliest end date of the two is used.- Type
Optional[
datetime.datetime
]
- weekdays¶
The days of the week that the event should repeat on. Only applicable for type
CustomRepeatInterval.weekly
.- Type
Optional[List[
Weekday
]]
Status¶
Exceptions¶
- exception guilded.GuildedException¶
Base class for all guilded.py exceptions.
- exception guilded.HTTPException(response, data)¶
A non-ok response from Guilded was returned whilst performing an HTTP request.
- response¶
The
aiohttp.ClientResponse
of the failed request.
- code¶
A PascalCase representation of the HTTP status code. Could also be called the error’s name. Probably not useful in most cases.
- Type
- exception guilded.BadRequest(response, data)¶
Thrown on status code 400
- exception guilded.Forbidden(response, data)¶
Thrown on status code 403
- raw_missing_permissions¶
If applicable, the permissions that the client is missing for the operation. This is a list of raw permissions values.
New in version 1.9.1.
- Type
Optional[List[
str
]]
- exception guilded.NotFound(response, data)¶
Thrown on status code 404
- exception guilded.ImATeapot(response, data)¶
Thrown on status code 418
Currently, this error should only be thrown from Read a server member’s permissions, when the member does not have all the permissions passed to
ids
.New in version 1.9.1.
- raw_missing_permissions¶
If applicable, the permissions that the member is missing. This is a list of raw permissions values.
- Type
Optional[List[
str
]]
- exception guilded.TooManyRequests(response, data)¶
Thrown on status code 429
- exception guilded.GuildedServerError(response, data)¶
Thrown on status code 500
- exception guilded.InvalidArgument¶
Thrown when an argument to a function is invalid some way (e.g. wrong value or wrong type).
This could be considered the analogous of
ValueError
andTypeError
except inherited fromClientException
and thusGuildedException
.
SocialLink¶
Represents a social link on a user’s profile.
Checks if two social links are equal.
Checks if two social links are not equal.
New in version 1.3.
The social link’s parent member or user.
Union[
Member
,User
]The ID of the social link’s parent user.
str
The type or platform that the social link is for.
SocialLinkType
The member’s handle on the external platform.
Optional[
str
]The member’s ID on the external platform.
Optional[
str
]When the social link was created.
datetime.datetime