illest.py 2.3.1
Embeds, permissions and intents
Read from the library itself: every signature and every word here is its own docstring.
Embed
classillest.Embed
class Embed(title: 'str | None' = None, description: 'str | None' = None, url: 'str | None' = None, *, colour: 'Colour | int | None' = None, color: 'Colour | int | None' = None, timestamp: '_dt.datetime | int | None' = None, type: 'str' = 'rich')
A card. Every setter returns the embed, so calls chain.
colour
propertycolor
propertytimestamp
propertyset_timestamp
set_timestamp(value: '_dt.datetime | int | None' = None) -> "'Embed'"
Now, when given nothing (a shorthand of this library's).
image
propertyset_image
set_image(url: 'str | None' = None) -> "'Embed'"
The card's picture, drawn full width. attachment://<filename> is a file sent with the message; an http(s) address
is fetched by the bot's server as the message is sent and sealed with it, so it shows in place and readers never reach
its host. An address the server will not fetch is shown as a link the reader may open.
thumbnail
propertyset_thumbnail
set_thumbnail(url: 'str | None' = None) -> "'Embed'"
A small picture at the card's top right, taken as set_image takes its picture.
video
propertyprovider
propertyfields
propertyadd_field
add_field(name: 'str', value: 'str', inline: 'bool' = True) -> "'Embed'"
insert_field_at
insert_field_at(index: 'int', name: 'str', value: 'str', inline: 'bool' = True) -> "'Embed'"
set_field_at
set_field_at(index: 'int', name: 'str', value: 'str', inline: 'bool' = True) -> "'Embed'"
remove_field
remove_field(index: 'int') -> "'Embed'"
clear_fields
clear_fields() -> "'Embed'"
copy
copy() -> "'Embed'"
to_dict
to_dict() -> 'dict[str, Any]'
The card as the wire carries it (content.ts's Embed), checked against every bound the client holds it to.
from_dict
classmethodfrom_dict(data: 'Mapping[str, Any]') -> "'Embed'"
An embed from the wire's shape, or from the common one (icon_url, an ISO timestamp, color).
File
classillest.File
class File(fp: 'str | bytes | os.PathLike | io.IOBase', filename: 'str | None' = None, *, spoiler: 'bool' = False, description: 'str | None' = None)
A file from a path, bytes, or an open binary file. spoiler=True names it SPOILER_..., which the client blurs.
read
read() -> 'bytes'
content_type
propertyreset
reset(*, seek: 'bool' = True) -> 'None'
close
close() -> 'None'
MediaGalleryItem
classillest.MediaGalleryItem
class MediaGalleryItem(media: 'Any', *, description: 'str | None' = None, spoiler: 'bool' = False)
One picture of a gallery.
to_picture
to_picture() -> 'dict[str, Any]'
UnfurledMediaItem
classillest.UnfurledMediaItem
class UnfurledMediaItem(url: 'str')
A picture or a file a layout shows: attachment://<filename> or an http(s) address.
SeparatorSpacing
classfrom Enumillest.SeparatorSpacing
class SeparatorSpacing(*values)
AskReply
classillest.AskReply
class AskReply(*, placeholder: 'str | None' = None, user: 'Any' = None)
to_wire
to_wire() -> 'dict[str, Any]'
AllowedMentions
classillest.AllowedMentions
class AllowedMentions(*, everyone: 'bool' = True, users: 'bool | list[Any]' = True, roles: 'bool | list[Any]' = True, replied_user: 'bool' = True)
everyone, users, roles and replied_user. users/roles may be True (all named), False
(none), or a list of the ones allowed.
all
classmethodall() -> "'AllowedMentions'"
none
classmethodnone() -> "'AllowedMentions'"
merge
merge(other: "'AllowedMentions'") -> "'AllowedMentions'"
allows_user
allows_user(user_id: 'int') -> 'bool'
Colour
classillest.Colour
class Colour(value: 'int')
r
propertyg
propertyb
propertyto_rgb
to_rgb() -> 'tuple[int, int, int]'
from_rgb
classmethodfrom_rgb(r: 'int', g: 'int', b: 'int') -> "'Colour'"
from_hsv
classmethodfrom_hsv(h: 'float', s: 'float', v: 'float') -> "'Colour'"
from_str
classmethodfrom_str(value: 'str') -> "'Colour'"
#fff, #f71a14, 0xf71a14, f71a14 or rgb(247, 26, 20).
default
classmethoddefault() -> "'Colour'"
random
classmethodrandom(*, seed: 'int | str | float | bytes | bytearray | None' = None) -> "'Colour'"
illest
classmethodillest() -> "'Colour'"
illest_light
classmethodillest_light() -> "'Colour'"
illest_dark
classmethodillest_dark() -> "'Colour'"
teal
classmethodteal()
dark_teal
classmethoddark_teal()
brand_green
classmethodbrand_green()
green
classmethodgreen()
dark_green
classmethoddark_green()
blue
classmethodblue()
dark_blue
classmethoddark_blue()
purple
classmethodpurple()
dark_purple
classmethoddark_purple()
magenta
classmethodmagenta()
dark_magenta
classmethoddark_magenta()
gold
classmethodgold()
dark_gold
classmethoddark_gold()
orange
classmethodorange()
dark_orange
classmethoddark_orange()
brand_red
classmethodbrand_red()
red
classmethodred()
dark_red
classmethoddark_red()
lighter_grey
classmethodlighter_grey()
lighter_gray
classmethodlighter_gray()
dark_grey
classmethoddark_grey()
dark_gray
classmethoddark_gray()
light_grey
classmethodlight_grey()
light_gray
classmethodlight_gray()
darker_grey
classmethoddarker_grey()
darker_gray
classmethoddarker_gray()
og_blurple
classmethodog_blurple()
blurple
classmethodblurple()
greyple
classmethodgreyple()
dark_theme
classmethoddark_theme()
fuchsia
classmethodfuchsia()
yellow
classmethodyellow()
dark_embed
classmethoddark_embed()
light_embed
classmethodlight_embed()
pink
classmethodpink()
Permissions
classillest.Permissions
class Permissions(permissions: 'int' = 0, **flags: 'bool')
A set of permission bits. Each name is a bool attribute; value is the integer the server stores.
is_subset
is_subset(other: "'Permissions'") -> 'bool'
is_superset
is_superset(other: "'Permissions'") -> 'bool'
is_strict_subset
is_strict_subset(other: "'Permissions'") -> 'bool'
is_strict_superset
is_strict_superset(other: "'Permissions'") -> 'bool'
update
update(**flags: 'bool') -> 'None'
handle_overwrite
handle_overwrite(allow: 'int', deny: 'int') -> 'None'
none
classmethodnone() -> "'Permissions'"
all
classmethodall() -> "'Permissions'"
all_channel
classmethodall_channel() -> "'Permissions'"
general
classmethodgeneral() -> "'Permissions'"
membership
classmethodmembership() -> "'Permissions'"
text
classmethodtext() -> "'Permissions'"
voice
classmethodvoice() -> "'Permissions'"
stage
classmethodstage() -> "'Permissions'"
stage_moderator
classmethodstage_moderator() -> "'Permissions'"
elevated
classmethodelevated() -> "'Permissions'"
advanced
classmethodadvanced() -> "'Permissions'"
events
classmethodevents() -> "'Permissions'"
apps
classmethodapps() -> "'Permissions'"
everyone
classmethodeveryone() -> "'Permissions'"
What a new server's @everyone holds (perms::DEFAULT_EVERYONE).
default
classmethoddefault() -> "'Permissions'"
What a new server's @everyone holds (perms::DEFAULT_EVERYONE).
PermissionOverwrite
classillest.PermissionOverwrite
class PermissionOverwrite(**flags: 'bool | None')
A channel's rule for one role or member: each permission allowed (True), denied (False) or left to the role (None).
pair
pair() -> 'tuple[Permissions, Permissions]'
from_pair
classmethodfrom_pair(allow: 'Permissions | int', deny: 'Permissions | int') -> "'PermissionOverwrite'"
is_empty
is_empty() -> 'bool'
update
update(**flags: 'bool | None') -> 'None'
Intents
classillest.Intents
class Intents(value: 'int | None' = None, **flags: 'bool')
A set of on/off flags, one per entry in FLAGS, each readable and settable as an attribute.
default
classmethoddefault() -> "'Intents'"
all
classmethodall() -> "'Intents'"
none
classmethodnone() -> "'Intents'"
from_value
classmethodfrom_value(value: 'int') -> "'Intents'"
value
propertyThe flags as one number, a bit per intent in name order (Intents(value) reads it back).
is_subset
is_subset(other: "'Intents'") -> 'bool'
flags
propertyEvery intent and whether it is on.
allows
allows(event: 'str') -> 'bool'
Whether a handler named event (on_message) is handed anything. An event no intent names always is.
unfed
unfed(scopes: 'set[str]') -> 'list[tuple[str, tuple[str, ...]]]'
The intents that are on and that none of scopes could feed, each with the scopes that would.
SelectOption
classillest.SelectOption
class SelectOption(*, label: 'str', value: 'Any' = None, description: 'str | None' = None, emoji: 'Any' = None, default: 'bool' = False)
to_wire
to_wire() -> 'dict[str, Any]'
from_wire
classmethodfrom_wire(d: 'dict[str, Any]') -> "'SelectOption'"