Channel
BaseChannel
¶
Bases: DiscordObject
Source code in interactions/models/discord/channel.py
776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 |
|
mention: str
property
¶
Returns a string that would mention the channel.
name: Optional[str] = attrs.field(repr=True, default=None)
class-attribute
¶
The name of the channel (1-100 characters)
permissions: Optional[Permissions] = attrs.field(repr=False, default=None, converter=optional_c(Permissions))
class-attribute
¶
Calculated permissions for the bot in this channel, only given when using channels as an option with slash commands
type: Union[ChannelType, int] = attrs.field(repr=True, converter=ChannelType)
class-attribute
¶
The channel topic (0-1024 characters)
delete(reason=MISSING)
async
¶
Delete this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reason | Absent[Optional[str]] | The reason for deleting this channel | MISSING |
Source code in interactions/models/discord/channel.py
903 904 905 906 907 908 909 910 911 |
|
edit(*, name=MISSING, icon=MISSING, type=MISSING, position=MISSING, topic=MISSING, nsfw=MISSING, rate_limit_per_user=MISSING, bitrate=MISSING, user_limit=MISSING, permission_overwrites=MISSING, parent_id=MISSING, rtc_region=MISSING, video_quality_mode=MISSING, default_auto_archive_duration=MISSING, flags=MISSING, archived=MISSING, auto_archive_duration=MISSING, locked=MISSING, invitable=MISSING, reason=MISSING, **kwargs)
async
¶
Edits the channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
icon | Absent[UPLOADABLE_TYPE] | DM Group icon | MISSING |
type | Absent[ChannelType] | The type of channel; only conversion between text and news is supported and only in guilds with the "NEWS" feature | MISSING |
position | Absent[int] | The position of the channel in the left-hand listing | MISSING |
topic | Absent[str] | 0-1024 character channel topic | MISSING |
nsfw | Absent[bool] | Whether the channel is nsfw | MISSING |
rate_limit_per_user | Absent[int] | Amount of seconds a user has to wait before sending another message (0-21600) | MISSING |
bitrate | Absent[int] | The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) | MISSING |
user_limit | Absent[int] | The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | Channel or category-specific permissions | MISSING |
parent_id | Absent[Snowflake_Type] | The id of the new parent category for a channel | MISSING |
rtc_region | Absent[Union[VoiceRegion, str]] | Channel voice region id, automatic when set to None. | MISSING |
video_quality_mode | Absent[VideoQualityMode] | The camera video quality mode of the voice channel | MISSING |
default_auto_archive_duration | Absent[AutoArchiveDuration] | The default duration that the clients use (not the API) for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity | MISSING |
flags | Absent[Union[int, ChannelFlags]] | Channel flags combined as a bitfield. Only REQUIRE_TAG is supported for now. | MISSING |
archived | Absent[bool] | Whether the thread is archived | MISSING |
auto_archive_duration | Absent[AutoArchiveDuration] | Duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 | MISSING |
locked | Absent[bool] | Whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it | MISSING |
invitable | Absent[bool] | Whether non-moderators can add other non-moderators to a thread; only available on private threads | MISSING |
reason | Absent[str] | The reason for editing the channel | MISSING |
Returns:
Type | Description |
---|---|
TYPE_ALL_CHANNEL | The edited channel. May be a new object if the channel type changes. |
Source code in interactions/models/discord/channel.py
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 |
|
from_dict_factory(data, client)
classmethod
¶
Creates a channel object of the appropriate type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | dict | The channel data. | required |
client | Client | The bot. | required |
Returns:
Type | Description |
---|---|
TYPE_ALL_CHANNEL | The new channel object. |
Source code in interactions/models/discord/channel.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
|
ChannelHistory
¶
Bases: AsyncIterator
An async iterator for searching through a channel's history.
Attributes:
Name | Type | Description |
---|---|---|
channel | BaseChannel | The channel to search through |
limit | BaseChannel | The maximum number of messages to return (set to 0 for no limit) |
before | Snowflake_Type | get messages before this message ID |
after | Snowflake_Type | get messages after this message ID |
around | Snowflake_Type | get messages "around" this message ID |
Source code in interactions/models/discord/channel.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
fetch()
async
¶
Fetch additional objects.
Your implementation of this method must return a list of objects. If no more objects are available, raise QueueEmpty
Returns:
Type | Description |
---|---|
List[Message] | List of objects |
Raises:
Type | Description |
---|---|
QueueEmpty | when no more objects are available. |
Source code in interactions/models/discord/channel.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
DM
¶
Bases: DMChannel
Source code in interactions/models/discord/channel.py
939 940 941 942 943 944 |
|
recipient: models.User
property
¶
Returns the user that is in this DM channel.
DMChannel
¶
Bases: BaseChannel
, MessageableMixin
Source code in interactions/models/discord/channel.py
918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 |
|
DMGroup
¶
Bases: DMChannel
Source code in interactions/models/discord/channel.py
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 |
|
application_id: Optional[Snowflake_Type] = attrs.field(repr=False, default=None)
class-attribute
¶
Application id of the group DM creator if it is bot-created
owner_id: Snowflake_Type = attrs.field(repr=True)
class-attribute
¶
id of the creator of the group DM
add_recipient(user, access_token, nickname=MISSING)
async
¶
Add a recipient to this DM Group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user | Union[User, Snowflake_Type] | The user to add | required |
access_token | str | access token of a user that has granted your app the gdm.join scope | required |
nickname | Absent[Optional[str]] | nickname to apply to the user being added | MISSING |
Source code in interactions/models/discord/channel.py
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 |
|
edit(*, name=MISSING, icon=MISSING, reason=MISSING, **kwargs)
async
¶
Edit this DM Channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
icon | Absent[UPLOADABLE_TYPE] | An icon to use | MISSING |
reason | Absent[str] | The reason for this change | MISSING |
Source code in interactions/models/discord/channel.py
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 |
|
fetch_owner(*, force=False)
async
¶
Fetch the owner of this DM group
Parameters:
Name | Type | Description | Default |
---|---|---|---|
force | bool | Whether to force a fetch from the API | False |
Source code in interactions/models/discord/channel.py
973 974 975 976 977 978 979 980 981 |
|
get_owner()
¶
Get the owner of this DM group
Source code in interactions/models/discord/channel.py
983 984 985 |
|
remove_recipient(user)
async
¶
Remove a recipient from this DM Group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user | Union[User, Snowflake_Type] | The user to remove | required |
Source code in interactions/models/discord/channel.py
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 |
|
GuildCategory
¶
Bases: GuildChannel
Source code in interactions/models/discord/channel.py
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 |
|
channels: List[TYPE_GUILD_CHANNEL]
property
¶
Get all channels within the category
news_channels: List[GuildNews]
property
¶
Get all news channels within the category
stage_channels: List[GuildStageVoice]
property
¶
Get all stage channels within the category
text_channels: List[GuildText]
property
¶
Get all text channels within the category
voice_channels: List[GuildVoice]
property
¶
Get all voice channels within the category
create_channel(channel_type, name, topic=MISSING, position=MISSING, permission_overwrites=MISSING, nsfw=False, bitrate=64000, user_limit=0, rate_limit_per_user=0, reason=MISSING)
async
¶
Create a guild channel within this category, allows for explicit channel type setting.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
channel_type | Union[ChannelType, int] | The type of channel to create | required |
name | str | The name of the channel | required |
topic | Absent[Optional[str]] | The topic of the channel | MISSING |
position | Absent[Optional[int]] | The position of the channel in the channel list | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | Permission overwrites to apply to the channel | MISSING |
nsfw | bool | Should this channel be marked nsfw | False |
bitrate | int | The bitrate of this channel, only for voice | 64000 |
user_limit | int | The max users that can be in this channel, only for voice | 0 |
rate_limit_per_user | int | The time users must wait between sending messages | 0 |
reason | Absent[Optional[str]] | The reason for creating this channel | MISSING |
Returns:
Type | Description |
---|---|
TYPE_GUILD_CHANNEL | The newly created channel. |
Source code in interactions/models/discord/channel.py
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 |
|
create_news_channel(name, topic=MISSING, position=MISSING, permission_overwrites=MISSING, nsfw=False, reason=MISSING)
async
¶
Create a news channel in this guild within this category.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the channel | required |
topic | Absent[Optional[str]] | The topic of the channel | MISSING |
position | Absent[Optional[int]] | The position of the channel in the channel list | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | Permission overwrites to apply to the channel | MISSING |
nsfw | bool | Should this channel be marked nsfw | False |
reason | Absent[Optional[str]] | The reason for creating this channel | MISSING |
Returns:
Type | Description |
---|---|
GuildNews | The newly created news channel. |
Source code in interactions/models/discord/channel.py
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 |
|
create_stage_channel(name, topic=MISSING, position=MISSING, permission_overwrites=MISSING, bitrate=64000, user_limit=0, reason=MISSING)
async
¶
Create a guild stage channel within this category.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the channel | required |
topic | Absent[Optional[str]] | The topic of the channel | MISSING |
position | Absent[Optional[int]] | The position of the channel in the channel list | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | Permission overwrites to apply to the channel | MISSING |
bitrate | int | The bitrate of this channel, only for voice | 64000 |
user_limit | int | The max users that can be in this channel, only for voice | 0 |
reason | Absent[Optional[str]] | The reason for creating this channel | MISSING |
Returns:
Type | Description |
---|---|
GuildStageVoice | The newly created stage channel. |
Source code in interactions/models/discord/channel.py
1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 |
|
create_text_channel(name, topic=MISSING, position=MISSING, permission_overwrites=MISSING, nsfw=False, rate_limit_per_user=0, reason=MISSING)
async
¶
Create a text channel in this guild within this category.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the channel | required |
topic | Absent[Optional[str]] | The topic of the channel | MISSING |
position | Absent[Optional[int]] | The position of the channel in the channel list | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | Permission overwrites to apply to the channel | MISSING |
nsfw | bool | Should this channel be marked nsfw | False |
rate_limit_per_user | int | The time users must wait between sending messages | 0 |
reason | Absent[Optional[str]] | The reason for creating this channel | MISSING |
Returns:
Type | Description |
---|---|
GuildText | The newly created text channel. |
Source code in interactions/models/discord/channel.py
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 |
|
create_voice_channel(name, topic=MISSING, position=MISSING, permission_overwrites=MISSING, nsfw=False, bitrate=64000, user_limit=0, reason=MISSING)
async
¶
Create a guild voice channel within this category.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the channel | required |
topic | Absent[Optional[str]] | The topic of the channel | MISSING |
position | Absent[Optional[int]] | The position of the channel in the channel list | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | Permission overwrites to apply to the channel | MISSING |
nsfw | bool | Should this channel be marked nsfw | False |
bitrate | int | The bitrate of this channel, only for voice | 64000 |
user_limit | int | The max users that can be in this channel, only for voice | 0 |
reason | Absent[Optional[str]] | The reason for creating this channel | MISSING |
Returns:
Type | Description |
---|---|
GuildVoice | The newly created voice channel. |
Source code in interactions/models/discord/channel.py
1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 |
|
edit(*, name=MISSING, position=MISSING, permission_overwrites=MISSING, reason=MISSING, **kwargs)
async
¶
Edit this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
position | Absent[int] | the position of the channel in the left-hand listing | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | channel or category-specific permissions | MISSING |
reason | Absent[str] | the reason for this change | MISSING |
Returns:
Type | Description |
---|---|
GuildCategory | The updated channel object. |
Source code in interactions/models/discord/channel.py
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 |
|
GuildChannel
¶
Bases: BaseChannel
Source code in interactions/models/discord/channel.py
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
|
bots: List[models.Member]
property
¶
Returns a list of bots that can see this channel.
category: Optional[GuildCategory]
property
¶
The parent category of this channel.
gui_position: int
property
¶
The position of this channel in the Discord interface.
guild: models.Guild
property
¶
The guild this channel belongs to.
humans: List[models.Member]
property
¶
Returns a list of humans that can see this channel.
members: List[models.Member]
property
¶
Returns a list of members that can see this channel.
nsfw: bool = attrs.field(repr=False, default=False)
class-attribute
¶
Whether the channel is nsfw
parent_id: Optional[Snowflake_Type] = attrs.field(repr=False, default=None, converter=optional_c(to_snowflake))
class-attribute
¶
id of the parent category for a channel (each parent category can contain up to 50 channels)
permission_overwrites: list[PermissionOverwrite] = attrs.field(repr=False, factory=list)
class-attribute
¶
A list of the overwritten permissions for the members and roles
position: Optional[int] = attrs.field(repr=False, default=0)
class-attribute
¶
Sorting position of the channel
add_permission(target, type=None, allow=None, deny=None, reason=None)
async
¶
Add a permission to this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target | Union[PermissionOverwrite, Role, User, Member, Snowflake_Type] | The updated PermissionOverwrite object, or the Role or User object/id to update | required |
type | Optional[OverwriteType] | The type of permission overwrite. Only applicable if target is an id | None |
allow | Optional[List[Permissions] | int] | List of permissions to allow. Only applicable if target is not an PermissionOverwrite object | None |
deny | Optional[List[Permissions] | int] | List of permissions to deny. Only applicable if target is not an PermissionOverwrite object | None |
reason | Optional[str] | The reason for this change | None |
Raises:
Type | Description |
---|---|
ValueError | Invalid target for permission |
Source code in interactions/models/discord/channel.py
1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 |
|
clone(name=None, reason=MISSING)
async
¶
Clone this channel and create a new one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Optional[str] | The name of the new channel. Defaults to the current name | None |
reason | Absent[Optional[str]] | The reason for creating this channel | MISSING |
Returns:
Type | Description |
---|---|
TYPE_GUILD_CHANNEL | The newly created channel. |
Source code in interactions/models/discord/channel.py
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
|
delete_permission(target, reason=MISSING)
async
¶
Delete a permission overwrite for this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target | Union[PermissionOverwrite, Role, User] | The permission overwrite to delete | required |
reason | Absent[Optional[str]] | The reason for this change | MISSING |
Source code in interactions/models/discord/channel.py
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
|
edit_permission(overwrite, reason=None)
async
¶
Edit the permissions for this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overwrite | PermissionOverwrite | The permission overwrite to apply | required |
reason | Optional[str] | The reason for this change | None |
Source code in interactions/models/discord/channel.py
1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 |
|
permissions_for(instance)
¶
Calculates permissions for an instance
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance | Snowflake_Type | Member or Role instance (or its ID) | required |
Returns:
Type | Description |
---|---|
Permissions | Permissions data |
Raises:
Type | Description |
---|---|
ValueError | If could not find any member or role by given ID |
RuntimeError | If given instance is from another guild |
Source code in interactions/models/discord/channel.py
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 |
|
set_permission(target, *, add_reactions=None, administrator=None, attach_files=None, ban_members=None, change_nickname=None, connect=None, create_instant_invite=None, deafen_members=None, embed_links=None, kick_members=None, manage_channels=None, manage_emojis_and_stickers=None, manage_events=None, manage_guild=None, manage_messages=None, manage_nicknames=None, manage_roles=None, manage_threads=None, manage_webhooks=None, mention_everyone=None, moderate_members=None, move_members=None, mute_members=None, priority_speaker=None, read_message_history=None, request_to_speak=None, send_messages=None, send_messages_in_threads=None, send_tts_messages=None, speak=None, start_embedded_activities=None, stream=None, use_application_commands=None, use_external_emojis=None, use_external_stickers=None, use_private_threads=None, use_public_threads=None, use_vad=None, view_audit_log=None, view_channel=None, view_guild_insights=None, reason=None)
async
¶
Set the Permission Overwrites for a given target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target | Union[Role, Member, User] | The target to set permission overwrites for | required |
add_reactions | bool | None | Allows for the addition of reactions to messages | None |
administrator | bool | None | Allows all permissions and bypasses channel permission overwrites | None |
attach_files | bool | None | Allows for uploading images and files | None |
ban_members | bool | None | Allows banning members | None |
change_nickname | bool | None | Allows for modification of own nickname | None |
connect | bool | None | Allows for joining of a voice channel | None |
create_instant_invite | bool | None | Allows creation of instant invites | None |
deafen_members | bool | None | Allows for deafening of members in a voice channel | None |
embed_links | bool | None | Links sent by users with this permission will be auto-embedded | None |
kick_members | bool | None | Allows kicking members | None |
manage_channels | bool | None | Allows management and editing of channels | None |
manage_emojis_and_stickers | bool | None | Allows management and editing of emojis and stickers | None |
manage_events | bool | None | Allows for creating, editing, and deleting scheduled events | None |
manage_guild | bool | None | Allows management and editing of the guild | None |
manage_messages | bool | None | Allows for deletion of other users messages | None |
manage_nicknames | bool | None | Allows for modification of other users nicknames | None |
manage_roles | bool | None | Allows management and editing of roles | None |
manage_threads | bool | None | Allows for deleting and archiving threads, and viewing all private threads | None |
manage_webhooks | bool | None | Allows management and editing of webhooks | None |
mention_everyone | bool | None | Allows for using the | None |
moderate_members | bool | None | Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels | None |
move_members | bool | None | Allows for moving of members between voice channels | None |
mute_members | bool | None | Allows for muting members in a voice channel | None |
priority_speaker | bool | None | Allows for using priority speaker in a voice channel | None |
read_message_history | bool | None | Allows for reading of message history | None |
request_to_speak | bool | None | Allows for requesting to speak in stage channels. (This permission is under active development and may be changed or removed.) | None |
send_messages | bool | None | Allows for sending messages in a channel (does not allow sending messages in threads) | None |
send_messages_in_threads | bool | None | Allows for sending messages in threads | None |
send_tts_messages | bool | None | Allows for sending of | None |
speak | bool | None | Allows for speaking in a voice channel | None |
start_embedded_activities | bool | None | Allows for using Activities (applications with the | None |
stream | bool | None | Allows the user to go live | None |
use_application_commands | bool | None | Allows members to use application commands, including slash commands and context menu commands | None |
use_external_emojis | bool | None | Allows the usage of custom emojis from other servers | None |
use_external_stickers | bool | None | Allows the usage of custom stickers from other servers | None |
use_private_threads | bool | None | Allows for creating private threads | None |
use_public_threads | bool | None | Allows for creating public and announcement threads | None |
use_vad | bool | None | Allows for using voice-activity-detection in a voice channel | None |
view_audit_log | bool | None | Allows for viewing of audit logs | None |
view_channel | bool | None | Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels | None |
view_guild_insights | bool | None | Allows for viewing guild insights | None |
reason | str | None | The reason for creating this overwrite | None |
Source code in interactions/models/discord/channel.py
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 |
|
GuildForum
¶
Bases: GuildChannel
, InvitableMixin
Source code in interactions/models/discord/channel.py
2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 |
|
available_tags: List[ThreadTag] = attrs.field(repr=False, factory=list)
class-attribute
¶
A list of tags available to assign to threads
default_forum_layout: ForumLayoutType = attrs.field(repr=False, default=ForumLayoutType.NOT_SET, converter=ForumLayoutType)
class-attribute
¶
The default forum layout view used to display posts in GUILD_FORUM channels. Defaults to 0, which indicates a layout view has not been set by a channel admin
default_reaction_emoji: Optional[DefaultReaction] = attrs.field(repr=False, default=None)
class-attribute
¶
The default emoji to react with for posts
default_sort_order: Optional[ForumSortOrder] = attrs.field(repr=False, default=None, converter=ForumSortOrder.converter)
class-attribute
¶
the default sort order type used to order posts in GUILD_FORUM channels. Defaults to null, which indicates a preferred sort order hasn't been set by a channel admin
rate_limit_per_user: int = attrs.field(repr=False, default=0)
class-attribute
¶
Amount of seconds a user has to wait before sending another message (0-21600)
archived_posts(limit=0, before=None)
¶
An async iterator for all archived posts in this channel.
Source code in interactions/models/discord/channel.py
2544 2545 2546 |
|
create_post(name, content, applied_tags=MISSING, *, auto_archive_duration=AutoArchiveDuration.ONE_DAY, rate_limit_per_user=MISSING, embeds=None, embed=None, components=None, stickers=None, allowed_mentions=None, files=None, file=None, tts=False, reason=MISSING)
async
¶
Create a post within this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the post | required |
content | str | None | The text content of this post | required |
applied_tags | Absent[List[Union[Snowflake_Type, ThreadTag, str]]] | A list of tag ids or tag objects to apply to this post | MISSING |
auto_archive_duration | AutoArchiveDuration | Time before the thread will be automatically archived. Note 3 day and 7 day archive durations require the server to be boosted. | AutoArchiveDuration.ONE_DAY |
rate_limit_per_user | Absent[int] | The time users must wait between sending messages | MISSING |
embeds | Optional[Union[List[Union[Embed, dict]], Union[Embed, dict]]] | Embedded rich content (up to 6000 characters). | None |
embed | Optional[Union[Embed, dict]] | Embedded rich content (up to 6000 characters). | None |
components | Optional[Union[List[List[Union[BaseComponent, dict]]], List[Union[BaseComponent, dict]], BaseComponent, dict]] | The components to include with the message. | None |
stickers | Optional[Union[List[Union[Sticker, Snowflake_Type]], Sticker, Snowflake_Type]] | IDs of up to 3 stickers in the server to send in the message. | None |
allowed_mentions | Optional[Union[AllowedMentions, dict]] | Allowed mentions for the message. | None |
files | Optional[Union[UPLOADABLE_TYPE, List[UPLOADABLE_TYPE]]] | Files to send, the path, bytes or File() instance, defaults to None. You may have up to 10 files. | None |
file | Optional[UPLOADABLE_TYPE] | Files to send, the path, bytes or File() instance, defaults to None. You may have up to 10 files. | None |
tts | bool | Should this message use Text To Speech. | False |
reason | Absent[str] | The reason for creating this post | MISSING |
Returns:
Type | Description |
---|---|
GuildForumPost | A GuildForumPost object representing the created post. |
Source code in interactions/models/discord/channel.py
2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 |
|
create_tag(name, emoji=None, moderated=False)
async
¶
Create a tag for this forum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the tag | required |
emoji | Union[PartialEmoji, dict, str, None] | The emoji to use for the tag | None |
moderated | bool | whether this tag can only be added to or removed from threads by a member with the MANAGE_THREADS permission | False |
Note
If the emoji is a custom emoji, it must be from the same guild as the channel.
Returns:
Type | Description |
---|---|
ThreadTag | The created tag object. |
Source code in interactions/models/discord/channel.py
2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 |
|
delete_tag(tag_id)
async
¶
Delete a tag for this forum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag_id | Snowflake_Type | The ID of the tag to delete | required |
Source code in interactions/models/discord/channel.py
2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 |
|
edit_tag(tag_id, *, name=None, emoji=None)
async
¶
Edit a tag for this forum.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag_id | Snowflake_Type | The id of the tag to edit | required |
name | str | None | The name for this tag | None |
emoji | Union[PartialEmoji, dict, str, None] | The emoji for this tag | None |
Source code in interactions/models/discord/channel.py
2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 |
|
fetch_post(id, *, force=False)
async
¶
Fetch a post within this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | Snowflake_Type | The id of the post to fetch | required |
force | bool | Whether to force a fetch from the API | False |
Returns:
Type | Description |
---|---|
GuildForumPost | A GuildForumPost object representing the post. |
Source code in interactions/models/discord/channel.py
2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 |
|
fetch_posts()
async
¶
Requests all active posts within this channel.
Returns:
Type | Description |
---|---|
List[GuildForumPost] | A list of GuildForumPost objects representing the posts. |
Source code in interactions/models/discord/channel.py
2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 |
|
get_post(id)
¶
Get a post within this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | Snowflake_Type | The id of the post to get | required |
Returns:
Type | Description |
---|---|
GuildForumPost | A GuildForumPost object representing the post. |
Source code in interactions/models/discord/channel.py
2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 |
|
get_posts(*, exclude_archived=True)
¶
List all, cached, active posts within this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exclude_archived | bool | Whether to exclude archived posts from the response | True |
Returns:
Type | Description |
---|---|
List[GuildForumPost] | A list of GuildForumPost objects representing the posts. |
Source code in interactions/models/discord/channel.py
2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 |
|
get_tag(value, *, case_insensitive=False)
¶
Get a tag within this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value | str | Snowflake_Type | The name or ID of the tag to get | required |
case_insensitive | bool | Whether to ignore case when searching for the tag | False |
Returns:
Type | Description |
---|---|
Optional[ThreadTag] | A ThreadTag object representing the tag. |
Source code in interactions/models/discord/channel.py
2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 |
|
GuildForumPost
¶
Bases: GuildPublicThread
A forum post
Note
This model is an abstraction of the api - In reality all posts are GuildPublicThread
Source code in interactions/models/discord/channel.py
2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 |
|
applied_tags: list[ThreadTag]
property
¶
The tags applied to this thread.
initial_post: Optional[Message]
property
¶
The initial message posted by the OP.
pinned: bool
property
¶
Whether this thread is pinned.
edit(*, name=MISSING, archived=MISSING, auto_archive_duration=MISSING, applied_tags=MISSING, locked=MISSING, rate_limit_per_user=MISSING, flags=MISSING, reason=MISSING, **kwargs)
async
¶
Edit this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
archived | Absent[bool] | whether the thread is archived | MISSING |
applied_tags | Absent[List[Union[Snowflake_Type, ThreadTag]]] | list of tags to apply | MISSING |
auto_archive_duration | Absent[AutoArchiveDuration] | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 | MISSING |
locked | Absent[bool] | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it | MISSING |
rate_limit_per_user | Absent[int] | amount of seconds a user has to wait before sending another message (0-21600) | MISSING |
flags | Absent[Union[int, ChannelFlags]] | channel flags to apply | MISSING |
reason | Absent[str] | The reason for this change | MISSING |
Returns:
Type | Description |
---|---|
GuildForumPost | The edited thread channel object. |
Source code in interactions/models/discord/channel.py
2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 |
|
pin(reason=MISSING)
async
¶
Pin this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reason | Absent[str] | The reason for this pin | MISSING |
Source code in interactions/models/discord/channel.py
2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 |
|
unpin(reason=MISSING)
async
¶
Unpin this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reason | Absent[str] | The reason for this unpin | MISSING |
Source code in interactions/models/discord/channel.py
2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 |
|
GuildNews
¶
Bases: GuildChannel
, MessageableMixin
, InvitableMixin
, ThreadableMixin
, WebhookMixin
Source code in interactions/models/discord/channel.py
1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 |
|
topic: Optional[str] = attrs.field(repr=False, default=None)
class-attribute
¶
The channel topic (0-1024 characters)
create_thread_from_message(name, message, auto_archive_duration=AutoArchiveDuration.ONE_DAY, reason=None)
async
¶
Creates a new news thread in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | 1-100 character thread name. | required |
message | Snowflake_Type | The message to connect this thread to. | required |
auto_archive_duration | AutoArchiveDuration | Time before the thread will be automatically archived. Note 3 day and 7 day archive durations require the server to be boosted. | AutoArchiveDuration.ONE_DAY |
reason | Absent[str] | None | The reason for creating this thread. | None |
Returns:
Type | Description |
---|---|
GuildNewsThread | The created public thread, if successful |
Source code in interactions/models/discord/channel.py
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 |
|
edit(*, name=MISSING, position=MISSING, permission_overwrites=MISSING, parent_id=MISSING, nsfw=MISSING, topic=MISSING, channel_type=MISSING, default_auto_archive_duration=MISSING, reason=MISSING, **kwargs)
async
¶
Edit the guild text channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
position | Absent[int] | the position of the channel in the left-hand listing | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | a list of PermissionOverwrite | MISSING |
parent_id | Absent[Snowflake_Type] | the parent category | MISSING |
nsfw | Absent[bool] | whether the channel is nsfw | MISSING |
topic | Absent[str] | 0-1024 character channel topic | MISSING |
channel_type | Absent[ChannelType] | the type of channel; only conversion between text and news is supported and only in guilds with the "NEWS" feature | MISSING |
default_auto_archive_duration | Absent[AutoArchiveDuration] | optional AutoArchiveDuration | MISSING |
reason | Absent[str] | An optional reason for the audit log | MISSING |
Returns:
Type | Description |
---|---|
Union[GuildNews, GuildText] | The edited channel. |
Source code in interactions/models/discord/channel.py
1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 |
|
follow(webhook_channel_id)
async
¶
Follow this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
webhook_channel_id | Snowflake_Type | The ID of the channel to post messages from this channel to | required |
Source code in interactions/models/discord/channel.py
1663 1664 1665 1666 1667 1668 1669 1670 1671 |
|
GuildNewsThread
¶
Bases: ThreadChannel
Source code in interactions/models/discord/channel.py
1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 |
|
edit(*, name=MISSING, archived=MISSING, auto_archive_duration=MISSING, locked=MISSING, rate_limit_per_user=MISSING, reason=MISSING, **kwargs)
async
¶
Edit this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
archived | Absent[bool] | whether the thread is archived | MISSING |
auto_archive_duration | Absent[AutoArchiveDuration] | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 | MISSING |
locked | Absent[bool] | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it | MISSING |
rate_limit_per_user | Absent[int] | amount of seconds a user has to wait before sending another message (0-21600) | MISSING |
reason | Absent[str] | The reason for this change | MISSING |
Returns:
Type | Description |
---|---|
GuildNewsThread | The edited thread channel object. |
Source code in interactions/models/discord/channel.py
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 |
|
GuildPrivateThread
¶
Bases: ThreadChannel
Source code in interactions/models/discord/channel.py
2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 |
|
invitable: bool = attrs.field(repr=False, default=False)
class-attribute
¶
Whether non-moderators can add other non-moderators to a thread
edit(*, name=MISSING, archived=MISSING, auto_archive_duration=MISSING, locked=MISSING, rate_limit_per_user=MISSING, invitable=MISSING, reason=MISSING, **kwargs)
async
¶
Edit this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
archived | Absent[bool] | whether the thread is archived | MISSING |
auto_archive_duration | Absent[AutoArchiveDuration] | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 | MISSING |
locked | Absent[bool] | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it | MISSING |
rate_limit_per_user | Absent[int] | amount of seconds a user has to wait before sending another message (0-21600) | MISSING |
invitable | Absent[bool] | whether non-moderators can add other non-moderators to a thread; only available on private threads | MISSING |
reason | Absent[str] | The reason for this change | MISSING |
Returns:
Type | Description |
---|---|
GuildPrivateThread | The edited thread channel object. |
Source code in interactions/models/discord/channel.py
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 |
|
GuildPublicThread
¶
Bases: ThreadChannel
Source code in interactions/models/discord/channel.py
2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 |
|
edit(*, name=MISSING, archived=MISSING, auto_archive_duration=MISSING, locked=MISSING, rate_limit_per_user=MISSING, flags=MISSING, reason=MISSING, **kwargs)
async
¶
Edit this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
archived | Absent[bool] | whether the thread is archived | MISSING |
auto_archive_duration | Absent[AutoArchiveDuration] | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 | MISSING |
locked | Absent[bool] | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it | MISSING |
rate_limit_per_user | Absent[int] | amount of seconds a user has to wait before sending another message (0-21600) | MISSING |
flags | Absent[Union[int, ChannelFlags]] | channel flags for forum threads | MISSING |
reason | Absent[str] | The reason for this change | MISSING |
Returns:
Type | Description |
---|---|
GuildPublicThread | The edited thread channel object. |
Source code in interactions/models/discord/channel.py
2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 |
|
GuildStageVoice
¶
Bases: GuildVoice
Source code in interactions/models/discord/channel.py
2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 |
|
stage_instance: models.StageInstance = attrs.field(repr=False, default=MISSING)
class-attribute
¶
The stage instance that this voice channel belongs to
close_stage(reason=MISSING)
async
¶
Closes the live stage instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reason | Absent[Optional[str]] | The reason for closing the stage | MISSING |
Source code in interactions/models/discord/channel.py
2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 |
|
create_stage_instance(topic, privacy_level=StagePrivacyLevel.GUILD_ONLY, reason=MISSING)
async
¶
Create a stage instance in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic | str | The topic of the stage (1-120 characters) | required |
privacy_level | StagePrivacyLevel | The privacy level of the stage | StagePrivacyLevel.GUILD_ONLY |
reason | Absent[Optional[str]] | The reason for creating this instance | MISSING |
Returns:
Type | Description |
---|---|
StageInstance | The created stage instance object. |
Source code in interactions/models/discord/channel.py
2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 |
|
fetch_stage_instance()
async
¶
Fetches the stage instance associated with this channel.
Returns:
Type | Description |
---|---|
StageInstance | The stage instance associated with this channel. If no stage is live, will return None. |
Source code in interactions/models/discord/channel.py
2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 |
|
GuildText
¶
Bases: GuildChannel
, MessageableMixin
, InvitableMixin
, ThreadableMixin
, WebhookMixin
Source code in interactions/models/discord/channel.py
1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 |
|
topic: Optional[str] = attrs.field(repr=False, default=None)
class-attribute
¶
The channel topic (0-1024 characters)
create_private_thread(name, invitable=MISSING, auto_archive_duration=AutoArchiveDuration.ONE_DAY, rate_limit_per_user=MISSING, reason=None)
async
¶
Creates a new private thread in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | 1-100 character thread name. | required |
invitable | Absent[bool] | Whether non-moderators can add other non-moderators to a thread. | MISSING |
rate_limit_per_user | Absent[int] | The time users must wait between sending messages (0-21600). | MISSING |
auto_archive_duration | AutoArchiveDuration | Time before the thread will be automatically archived. Note 3 day and 7 day archive durations require the server to be boosted. | AutoArchiveDuration.ONE_DAY |
reason | Absent[str] | None | The reason for creating this thread. | None |
Returns:
Type | Description |
---|---|
GuildPrivateThread | The created thread, if successful |
Source code in interactions/models/discord/channel.py
1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 |
|
create_public_thread(name, auto_archive_duration=AutoArchiveDuration.ONE_DAY, rate_limit_per_user=MISSING, reason=None)
async
¶
Creates a new public thread in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | 1-100 character thread name. | required |
auto_archive_duration | AutoArchiveDuration | Time before the thread will be automatically archived. Note 3 day and 7 day archive durations require the server to be boosted. | AutoArchiveDuration.ONE_DAY |
rate_limit_per_user | Absent[int] | The time users must wait between sending messages (0-21600). | MISSING |
reason | Absent[str] | None | The reason for creating this thread. | None |
Returns:
Type | Description |
---|---|
GuildPublicThread | The created public thread, if successful |
Source code in interactions/models/discord/channel.py
1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 |
|
create_thread_from_message(name, message, auto_archive_duration=AutoArchiveDuration.ONE_DAY, reason=None)
async
¶
Creates a new public thread in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | 1-100 character thread name. | required |
message | Snowflake_Type | The message to connect this thread to. | required |
auto_archive_duration | AutoArchiveDuration | Time before the thread will be automatically archived. Note 3 day and 7 day archive durations require the server to be boosted. | AutoArchiveDuration.ONE_DAY |
reason | Absent[str] | None | The reason for creating this thread. | None |
Returns:
Type | Description |
---|---|
GuildPublicThread | The created public thread, if successful |
Source code in interactions/models/discord/channel.py
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 |
|
edit(*, name=MISSING, position=MISSING, permission_overwrites=MISSING, parent_id=MISSING, nsfw=MISSING, topic=MISSING, channel_type=MISSING, default_auto_archive_duration=MISSING, rate_limit_per_user=MISSING, reason=MISSING, **kwargs)
async
¶
Edit the guild text channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
position | Absent[int] | the position of the channel in the left-hand listing | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | a list of PermissionOverwrite | MISSING |
parent_id | Absent[Snowflake_Type] | the parent category | MISSING |
nsfw | Absent[bool] | whether the channel is nsfw | MISSING |
topic | Absent[str] | 0-1024 character channel topic | MISSING |
channel_type | Absent[ChannelType] | the type of channel; only conversion between text and news is supported and only in guilds with the "NEWS" feature | MISSING |
default_auto_archive_duration | Absent[AutoArchiveDuration] | optional AutoArchiveDuration | MISSING |
rate_limit_per_user | Absent[int] | amount of seconds a user has to wait before sending another message (0-21600) | MISSING |
reason | Absent[str] | An optional reason for the audit log | MISSING |
Returns:
Type | Description |
---|---|
Union[GuildText, GuildNews] | The edited channel. |
Source code in interactions/models/discord/channel.py
1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 |
|
InvitableMixin
¶
Source code in interactions/models/discord/channel.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
|
create_invite(max_age=86400, max_uses=0, temporary=False, unique=False, target_type=None, target_user=None, target_application=None, reason=None)
async
¶
Creates a new channel invite.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_age | int | Max age of invite in seconds, default 86400 (24 hours). | 86400 |
max_uses | int | Max uses of invite, default 0. | 0 |
temporary | bool | Grants temporary membership, default False. | False |
unique | bool | Invite is unique, default false. | False |
target_type | Optional[InviteTargetType] | Target type for streams and embedded applications. | None |
target_user | Optional[Union[Snowflake_Type, User]] | Target User ID for Stream target type. | None |
target_application | Optional[Union[Snowflake_Type, Application]] | Target Application ID for Embedded App target type. | None |
reason | Optional[str] | The reason for creating this invite. | None |
Returns:
Type | Description |
---|---|
Invite | Newly created Invite object. |
Source code in interactions/models/discord/channel.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 |
|
fetch_invites()
async
¶
Fetches all invites (with invite metadata) for the channel.
Returns:
Type | Description |
---|---|
List[Invite] | List of Invite objects. |
Source code in interactions/models/discord/channel.py
546 547 548 549 550 551 552 553 554 555 |
|
MessageableMixin
¶
Bases: SendMixin
Source code in interactions/models/discord/channel.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
|
default_auto_archive_duration: int = attrs.field(repr=False, default=AutoArchiveDuration.ONE_DAY)
class-attribute
¶
Default duration that the clients (not the API) will use for newly created threads, in minutes, to automatically archive the thread after recent activity
last_message_id: Optional[Snowflake_Type] = attrs.field(repr=False, default=None)
class-attribute
¶
The id of the last message sent in this channel (may not point to an existing or valid message)
last_pin_timestamp: Optional[models.Timestamp] = attrs.field(repr=False, default=None, converter=optional_c(timestamp_converter))
class-attribute
¶
When the last pinned message was pinned. This may be None when a message is not pinned.
rate_limit_per_user: int = attrs.field(repr=False, default=0)
class-attribute
¶
Amount of seconds a user has to wait before sending another message (0-21600)
typing: Typing
property
¶
A context manager to send a typing state to a given channel as long as long as the wrapped operation takes.
delete_message(message, reason=None)
async
¶
Delete a single message from a channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message | Union[Snowflake_Type, Message] | The message to delete | required |
reason | str | None | The reason for this action | None |
Source code in interactions/models/discord/channel.py
394 395 396 397 398 399 400 401 402 403 404 |
|
delete_messages(messages, reason=MISSING)
async
¶
Bulk delete messages from channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
messages | List[Union[Snowflake_Type, Message]] | List of messages or message IDs to delete. | required |
reason | Absent[Optional[str]] | The reason for this action. Used for audit logs. | MISSING |
Source code in interactions/models/discord/channel.py
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
|
fetch_message(message_id, *, force=False)
async
¶
Fetch a message from the channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message_id | Snowflake_Type | ID of message to retrieve. | required |
force | bool | Whether to force a fetch from the API. | False |
Returns:
Type | Description |
---|---|
Optional[Message] | The message object fetched. If the message is not found, returns None. |
Source code in interactions/models/discord/channel.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
fetch_messages(limit=50, around=MISSING, before=MISSING, after=MISSING)
async
¶
Fetch multiple messages from the channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit | int | Max number of messages to return, default | 50 |
around | Snowflake_Type | Message to get messages around | MISSING |
before | Snowflake_Type | Message to get messages before | MISSING |
after | Snowflake_Type | Message to get messages after | MISSING |
Returns:
Type | Description |
---|---|
List[Message] | A list of messages fetched. |
Source code in interactions/models/discord/channel.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
fetch_pinned_messages()
async
¶
Fetch pinned messages from the channel.
Returns:
Type | Description |
---|---|
List[Message] | A list of messages fetched. |
Source code in interactions/models/discord/channel.py
361 362 363 364 365 366 367 368 369 370 |
|
get_message(message_id)
¶
Get a message from the channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message_id | Snowflake_Type | ID of message to retrieve. | required |
Returns:
Type | Description |
---|---|
Message | The message object fetched. |
Source code in interactions/models/discord/channel.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|
history(limit=100, before=None, after=None, around=None)
¶
Get an async iterator for the history of this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit | int | The maximum number of messages to return (set to 0 for no limit) | 100 |
before | Snowflake_Type | get messages before this message ID | None |
after | Snowflake_Type | get messages after this message ID | None |
around | Snowflake_Type | get messages "around" this message ID | None |
Example Usage:
1 2 3 4 5 |
|
1 2 3 |
|
Returns:
Type | Description |
---|---|
ChannelHistory | ChannelHistory (AsyncIterator) |
Source code in interactions/models/discord/channel.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
|
purge(deletion_limit=50, search_limit=100, predicate=MISSING, avoid_loading_msg=True, return_messages=False, before=MISSING, after=MISSING, around=MISSING, reason=MISSING)
async
¶
Bulk delete messages within a channel. If a predicate
is provided, it will be used to determine which messages to delete, otherwise all messages will be deleted within the deletion_limit
.
Example Usage:
1 2 3 |
|
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deletion_limit | int | The target amount of messages to delete | 50 |
search_limit | int | How many messages to search through | 100 |
predicate | Callable[[Message], bool] | A function that returns True or False, and takes a message as an argument | MISSING |
avoid_loading_msg | bool | Should the bot attempt to avoid deleting its own loading messages (recommended enabled) | True |
return_messages | bool | Should the bot return the messages that were deleted | False |
before | Optional[Snowflake_Type] | Search messages before this ID | MISSING |
after | Optional[Snowflake_Type] | Search messages after this ID | MISSING |
around | Optional[Snowflake_Type] | Search messages around this ID | MISSING |
reason | Absent[Optional[str]] | The reason for this deletion | MISSING |
Returns:
Type | Description |
---|---|
int | List[Message] | The total amount of messages deleted |
Source code in interactions/models/discord/channel.py
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
|
trigger_typing()
async
¶
Trigger a typing animation in this channel.
Source code in interactions/models/discord/channel.py
479 480 481 |
|
PermissionOverwrite
¶
Bases: SnowflakeObject
, DictSerializationMixin
Channel Permissions Overwrite object.
Note
id
here is not an attribute of the overwrite, it is the ID of the overwritten instance
Source code in interactions/models/discord/channel.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
allow: Optional[Permissions] = attrs.field(repr=True, converter=optional_c(Permissions), kw_only=True, default=None)
class-attribute
¶
Permissions to allow
deny: Optional[Permissions] = attrs.field(repr=True, converter=optional_c(Permissions), kw_only=True, default=None)
class-attribute
¶
Permissions to deny
type: OverwriteType = attrs.field(repr=True, converter=OverwriteType)
class-attribute
¶
Permission overwrite type (role or member)
add_allows(*perms)
¶
Add permissions to allow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*perms | Permissions | Permissions to add | () |
Source code in interactions/models/discord/channel.py
206 207 208 209 210 211 212 213 214 215 216 217 |
|
add_denies(*perms)
¶
Add permissions to deny.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*perms | Permissions | Permissions to add | () |
Source code in interactions/models/discord/channel.py
219 220 221 222 223 224 225 226 227 228 229 230 |
|
for_target(target_type)
classmethod
¶
Create a PermissionOverwrite for a role or member.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_type | Union[Role, Member, User] | The type of the target (role or member) | required |
Returns:
Type | Description |
---|---|
PermissionOverwrite | PermissionOverwrite |
Source code in interactions/models/discord/channel.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
ThreadChannel
¶
Bases: BaseChannel
, MessageableMixin
, WebhookMixin
Source code in interactions/models/discord/channel.py
1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 |
|
archive_timestamp: Optional[models.Timestamp] = attrs.field(repr=False, default=None, converter=optional_c(timestamp_converter))
class-attribute
¶
Timestamp when the thread's archive status was last changed, used for calculating recent activity
archived: bool = attrs.field(repr=False, default=False)
class-attribute
¶
Whether the thread is archived
auto_archive_duration: int = attrs.field(repr=False, default=attrs.Factory(lambda self: self.default_auto_archive_duration, takes_self=True))
class-attribute
¶
Duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
clyde_created: bool
property
¶
Whether this thread was created by Clyde.
create_timestamp: Optional[models.Timestamp] = attrs.field(repr=False, default=None, converter=optional_c(timestamp_converter))
class-attribute
¶
Timestamp when the thread was created
flags: ChannelFlags = attrs.field(repr=False, default=ChannelFlags.NONE, converter=ChannelFlags)
class-attribute
¶
Flags for the thread
guild: models.Guild
property
¶
The guild this channel belongs to.
is_private: bool
property
¶
Is this a private thread?
locked: bool = attrs.field(repr=False, default=False)
class-attribute
¶
Whether the thread is locked
member_count: int = attrs.field(repr=False, default=0)
class-attribute
¶
An approximate count of users in a thread, stops counting at 50
mention: str
property
¶
Returns a string that would mention this thread.
message_count: int = attrs.field(repr=False, default=0)
class-attribute
¶
An approximate count of messages in a thread, stops counting at 50
owner_id: Snowflake_Type = attrs.field(repr=False, default=None, converter=optional_c(to_snowflake))
class-attribute
¶
id of the creator of the thread
parent_channel: Union[GuildText, GuildForum]
property
¶
The channel this thread is a child of.
parent_id: Snowflake_Type = attrs.field(repr=False, default=None, converter=optional_c(to_snowflake))
class-attribute
¶
id of the text channel this thread was created
parent_message: Optional[Message]
property
¶
The message this thread is a child of.
permission_overwrites: List[PermissionOverwrite]
property
¶
The permission overwrites for this channel.
topic: Optional[str] = attrs.field(repr=False, default=None)
class-attribute
¶
The thread topic (0-1024 characters)
add_member(member)
async
¶
Add a member to this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
member | Union[Member, Snowflake_Type] | The member to add | required |
Source code in interactions/models/discord/channel.py
1947 1948 1949 1950 1951 1952 1953 1954 1955 |
|
archive(locked=False, reason=MISSING)
async
¶
Helper method to archive this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
locked | bool | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it | False |
reason | Absent[str] | The reason for this archive | MISSING |
Returns:
Type | Description |
---|---|
TYPE_THREAD_CHANNEL | The archived thread channel object. |
Source code in interactions/models/discord/channel.py
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 |
|
fetch_members()
async
¶
Get the members that have access to this thread.
Source code in interactions/models/discord/channel.py
1942 1943 1944 1945 |
|
join()
async
¶
Join this thread.
Source code in interactions/models/discord/channel.py
1967 1968 1969 |
|
leave()
async
¶
Leave this thread.
Source code in interactions/models/discord/channel.py
1971 1972 1973 |
|
permissions_for(instance)
¶
Calculates permissions for an instance
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance | Snowflake_Type | Member or Role instance (or its ID) | required |
Returns:
Type | Description |
---|---|
Permissions | Permissions data |
Raises:
Type | Description |
---|---|
ValueError | If could not find any member or role by given ID |
RuntimeError | If given instance is from another guild |
Source code in interactions/models/discord/channel.py
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 |
|
remove_member(member)
async
¶
Remove a member from this thread.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
member | Union[Member, Snowflake_Type] | The member to remove | required |
Source code in interactions/models/discord/channel.py
1957 1958 1959 1960 1961 1962 1963 1964 1965 |
|
ThreadableMixin
¶
Source code in interactions/models/discord/channel.py
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|
create_thread(name, message=MISSING, thread_type=MISSING, invitable=MISSING, rate_limit_per_user=MISSING, auto_archive_duration=AutoArchiveDuration.ONE_DAY, reason=None)
async
¶
Creates a new thread in this channel. If a message is provided, it will be used as the initial message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | 1-100 character thread name | required |
message | Absent[Snowflake_Type] | The message to connect this thread to. Required for news channel. | MISSING |
thread_type | Absent[ChannelType] | Is the thread private or public. Not applicable to news channel, it will always be GUILD_NEWS_THREAD. | MISSING |
invitable | Absent[bool] | whether non-moderators can add other non-moderators to a thread. Only applicable when creating a private thread. | MISSING |
rate_limit_per_user | Absent[int] | The time users must wait between sending messages (0-21600). | MISSING |
auto_archive_duration | AutoArchiveDuration | Time before the thread will be automatically archived. Note 3 day and 7 day archive durations require the server to be boosted. | AutoArchiveDuration.ONE_DAY |
reason | Absent[str] | None | The reason for creating this thread. | None |
Returns:
Type | Description |
---|---|
TYPE_THREAD_CHANNEL | The created thread, if successful |
Source code in interactions/models/discord/channel.py
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 |
|
fetch_active_threads()
async
¶
Gets all active threads in the channel, including public and private threads.
Returns:
Type | Description |
---|---|
ThreadList | A |
Source code in interactions/models/discord/channel.py
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
|
fetch_all_threads()
async
¶
Gets all threads in the channel. Active and archived, including public and private threads.
Returns:
Type | Description |
---|---|
ThreadList | A |
Source code in interactions/models/discord/channel.py
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|
fetch_archived_threads(limit=None, before=None)
async
¶
Get a ThreadList
of archived threads available in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit | int | None | optional maximum number of threads to return | None |
before | Optional[Timestamp] | Returns threads before this timestamp | None |
Returns:
Type | Description |
---|---|
ThreadList | A |
Source code in interactions/models/discord/channel.py
647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 |
|
fetch_joined_private_archived_threads(limit=None, before=None)
async
¶
Get a ThreadList
of threads the bot is a participant of in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit | int | None | optional maximum number of threads to return | None |
before | Optional[Timestamp] | Returns threads before this timestamp | None |
Returns:
Type | Description |
---|---|
ThreadList | A |
Source code in interactions/models/discord/channel.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 |
|
fetch_private_archived_threads(limit=None, before=None)
async
¶
Get a ThreadList
of archived private threads available in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit | int | None | optional maximum number of threads to return | None |
before | Optional[Timestamp] | Returns threads before this timestamp | None |
Returns:
Type | Description |
---|---|
ThreadList | A |
Source code in interactions/models/discord/channel.py
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
|
fetch_public_archived_threads(limit=None, before=None)
async
¶
Get a ThreadList
of archived public threads available in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit | int | None | optional maximum number of threads to return | None |
before | Optional[Timestamp] | Returns threads before this timestamp | None |
Returns:
Type | Description |
---|---|
ThreadList | A |
Source code in interactions/models/discord/channel.py
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
|
VoiceChannel
¶
Bases: GuildChannel
Source code in interactions/models/discord/channel.py
2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 |
|
bitrate: int = attrs.field(repr=False)
class-attribute
¶
The bitrate (in bits) of the voice channel
members: List[models.Member]
property
¶
Returns a list of members that have access to this voice channel
rtc_region: str = attrs.field(repr=False, default='auto')
class-attribute
¶
Voice region id for the voice channel, automatic when set to None
user_limit: int = attrs.field(repr=False)
class-attribute
¶
The user limit of the voice channel
video_quality_mode: Union[VideoQualityMode, int] = attrs.field(repr=False, default=VideoQualityMode.AUTO)
class-attribute
¶
The camera video quality mode of the voice channel, 1 when not present
voice_members: List[models.Member]
property
¶
Returns a list of members that are currently in the channel.
Note
This will not be accurate if the bot was offline while users joined the channel
voice_state: Optional[ActiveVoiceState]
property
¶
Returns the voice state of the bot in this channel if it is connected
connect(muted=False, deafened=False)
async
¶
Connect the bot to this voice channel, or move the bot to this voice channel if it is already connected in another voice channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
muted | bool | Whether the bot should be muted when connected. | False |
deafened | bool | Whether the bot should be deafened when connected. | False |
Returns:
Type | Description |
---|---|
ActiveVoiceState | The new active voice state on successfully connection. |
Source code in interactions/models/discord/channel.py
2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 |
|
disconnect()
async
¶
Disconnect from the currently connected voice state.
Raises:
Type | Description |
---|---|
VoiceNotConnected | if the bot is not connected to a voice channel |
Source code in interactions/models/discord/channel.py
2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 |
|
edit(*, name=MISSING, position=MISSING, permission_overwrites=MISSING, parent_id=MISSING, bitrate=MISSING, user_limit=MISSING, rtc_region=MISSING, video_quality_mode=MISSING, reason=MISSING, **kwargs)
async
¶
Edit guild voice channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | Absent[str] | 1-100 character channel name | MISSING |
position | Absent[int] | the position of the channel in the left-hand listing | MISSING |
permission_overwrites | Absent[Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]]] | a list of | MISSING |
parent_id | Absent[Snowflake_Type] | the parent category | MISSING |
bitrate | Absent[int] | the bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) | MISSING |
user_limit | Absent[int] | the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit | MISSING |
rtc_region | Absent[str] | channel voice region id, automatic when not set | MISSING |
video_quality_mode | Absent[VideoQualityMode] | the camera video quality mode of the voice channel | MISSING |
reason | Absent[str] | optional reason for audit logs | MISSING |
Returns:
Type | Description |
---|---|
Union[GuildVoice, GuildStageVoice] | The edited voice channel object. |
Source code in interactions/models/discord/channel.py
2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 |
|
WebhookMixin
¶
Source code in interactions/models/discord/channel.py
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 |
|
create_webhook(name, avatar=MISSING)
async
¶
Create a webhook in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | The name of the webhook | required |
avatar | Absent[UPLOADABLE_TYPE] | An optional default avatar image to use | MISSING |
Returns:
Type | Description |
---|---|
Webhook | The created webhook object |
Raises:
Type | Description |
---|---|
ValueError | If you try to name the webhook "Clyde" |
Source code in interactions/models/discord/channel.py
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
|
delete_webhook(webhook)
async
¶
Delete a given webhook in this channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
webhook | Webhook | The webhook to delete | required |
Source code in interactions/models/discord/channel.py
754 755 756 757 758 759 760 761 762 |
|
fetch_webhooks()
async
¶
Fetches all the webhooks for this channel.
Returns:
Type | Description |
---|---|
List[Webhook] | List of webhook objects |
Source code in interactions/models/discord/channel.py
764 765 766 767 768 769 770 771 772 773 |
|
process_permission_overwrites(overwrites)
¶
Processes a permission overwrite lists into format for sending to discord.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overwrites | Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]] | The permission overwrites to process | required |
Returns:
Type | Description |
---|---|
List[dict] | The processed permission overwrites |
Source code in interactions/models/discord/channel.py
2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 |
|