Permissions

class Permissions(*values)

Bases: IntFlag

CREATE_INSTANT_INVITE = 1
KICK_MEMBERS = 2
BAN_MEMBERS = 4
ADMINISTRATOR = 8
MANAGE_CHANNELS = 16
MANAGE_GUILD = 32
ADD_REACTIONS = 64
VIEW_AUDIT_LOG = 128
PRIORITY_SPEAKER = 256
STREAM = 512
VIEW_CHANNEL = 1024
SEND_MESSAGES = 2048
SEND_TTS_MESSAGES = 4096
MANAGE_MESSAGES = 8192
ATTACH_FILES = 32768
READ_MESSAGE_HISTORY = 65536
MENTION_EVERYONE = 131072
USE_EXTERNAL_EMOJIS = 262144
VIEW_GUILD_INSIGHTS = 524288
CONNECT = 1048576
SPEAK = 2097152
MUTE_MEMBERS = 4194304
DEAFEN_MEMBERS = 8388608
MOVE_MEMBERS = 16777216
USE_VAD = 33554432
CHANGE_NICKNAME = 67108864
MANAGE_NICKNAMES = 134217728
MANAGE_ROLES = 268435456
MANAGE_WEBHOOKS = 536870912
MANAGE_GUILD_EXPRESSIONS = 1073741824
USE_APPLICATIONS_COMMANDS = 2147483648
REQUEST_TO_SPEAK = 4294967296
MANAGE_EVENTS = 8589934592
MANAGE_THREADS = 17179869184
CREATE_PUBLIC_THREADS = 34359738368
CREATE_PRIVATE_THREADS = 68719476736
USE_EXTERNAL_STICKERS = 137438953472
SEND_MESSAGES_IN_THREADS = 274877906944
USE_EMBEDDED_ACTIVITIES = 549755813888
MODERATE_MEMBERS = 1099511627776
VIEW_CREATOR_MONETIZATION_ANALYTICS = 2199023255552
USE_SOUNDBOARD = 4398046511104
CREATE_GUILD_EXPRESSIONS = 8796093022208
CREATE_EVENTS = 17592186044416
USE_EXTERNAL_SOUNDS = 35184372088832
SEND_VOICE_MESSAGES = 70368744177664
SET_VOICE_CHANNEL_STATUS = 281474976710656
SEND_POLLS = 562949953421312
USE_EXTERNAL_APPS = 1125899906842624
PIN_MESSAGES = 2251799813685248
BYPASS_SLOWMODE = 4503599627370496
conjugate()

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
to_bytes(length=1, byteorder='big', *, signed=False)

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

classmethod from_bytes(bytes, byteorder='big', *, signed=False)

Return the integer represented by the given array of bytes.

bytes

Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Indicates whether two’s complement is used to represent the integer.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

The ratio is in lowest terms and has a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()

Returns True. Exists for duck type compatibility with float.is_integer.

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms