232 Commits

Author SHA1 Message Date
Rapptz
b850c9cd5d Add GuildChannel.move helper method to help with moving channels
Moving channels is seen as a complicated task, so hopefully this
abstracts a lot of it for users. There is no bulk move helper yet
since I'm unsure how the API for that should be.
2021-03-30 03:21:09 -04:00
Nadir Chowdhury
7d345e8e4e
remove trailing whitespace 2021-03-13 00:42:25 -05:00
SuzuZusu
b903066e4d
Allow for callable class factories in abc.Connectable.connect 2021-02-24 21:14:42 -05:00
Sebastian Law
2f15e7d8e4
fix mention_author in send causing unexpected allowed mentions 2021-02-24 03:06:44 -05:00
Rapptz
272339d5e6 Add support for the new permission serialization scheme. 2021-02-18 07:26:20 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Misa
fff2234823
Fix wrong documented permission for GuildChannel.invites()
I tested it just now, and manage_guild is not the permission you need to
fetch invites from a given channel. You need manage_channels.

Note that this isn't the same as Guild.invites(), which DOES use
manage_guild.
2020-12-07 18:34:51 -05:00
Nadir Chowdhury
6b803acde4
[chore] Remove redundant imports
This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1.
2020-11-28 03:16:49 -05:00
Rapptz
bd6ab93348 Code cleanup involving enums and message replies 2020-11-27 00:32:08 -05:00
PikalaxALT
d1cb30cccf
Implement discord.Message.reply 2020-11-26 23:19:00 -05:00
webtax-gh
25f23ec113 Properly document that categories throw 404's on create_invite. 2020-11-21 22:16:41 -05:00
Rapptz
b9e1bdf87e Properly insert at the end if position is not found when moving.
Fixes #5923
2020-10-17 01:52:35 -04:00
Rapptz
f2de794bde Intern status and overwrite strings 2020-09-23 03:21:20 -04:00
Rapptz
0b93fa3a82 Implement VoiceProtocol lower level hooks.
This allows changing the connect flow and taking control of it without
relying on internal events or tricks.
2020-09-23 03:20:35 -04:00
Michael
93fa46713a
Fix and add documentation 2020-09-23 03:19:35 -04:00
Xua
6ae615baae
Fix allowed_mentions when sending files 2020-09-20 00:14:00 -04:00
Rapptz
986adae108 Revert "Add fetch_message_fast using history endpoint"
This reverts commit a309088ae4be7c2e837e5d180822c0f9060fe86d.

A rate limited was added to this method after 5 years defeating the
purpose of it.
2020-09-14 01:18:09 -04:00
Duck
ddc4ad24f4
Add missing permission in clone documentation 2020-09-11 04:55:26 -04:00
Dan Hess
a1a4a4fd7f
Fix comparison for overwrites when checking if a channel is synced 2020-09-09 19:49:05 -04:00
khazhyk
a309088ae4
Add fetch_message_fast using history endpoint 2020-09-07 23:04:11 -04:00
parafoxia
1f4f010e51
Fix issue with empty overwrites
Fixes #5756.
2020-08-25 22:45:32 -04:00
Rapptz
45752ab354 Document merging behaviour of AllowedMentions in Messageable.send 2020-08-22 17:14:02 -04:00
Rapptz
14fd3dbaa7 Optimize Channel.permissions_for by not creating temporary objects
This seemed to have shaved a few microseconds:
10.8 µs ± 79.6 ns per loop → 8.53 µs ± 48.1 ns per loop
12 µs ± 613 ns per loop → 8.72 µs ± 30.2 ns per loop

With 100K loops each
2020-08-01 19:48:15 -04:00
Rapptz
0bc15fa130 Don't use a namedtuple for _Overwrites
Fix #5109
2020-07-08 23:18:13 -04:00
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
NCPlayz
bd1420b5f0 Allow editing of channel types for news and text channels 2020-05-29 23:21:59 -04:00
jack1142
fbb7add01a Specify the unit for max_age arg in GuildChannel.create_invite() 2020-05-07 02:30:24 -04:00
Rapptz
8ff285fcbc Documentation fixups for allowed mentions 2020-04-04 13:32:47 -04:00
Rapptz
d853a57e86 Rename allowed mention parameters to allowed_mentions 2020-04-04 13:22:51 -04:00
Rapptz
481b335f2d Fix various implementation bugs with allowed mentions 2020-04-04 12:45:17 -04:00
Rapptz
041785937e Add support for configuring allowed mentions per message or bot wide. 2020-04-04 07:40:51 -04:00
Rapptz
02397306b2 Drop superfluous zero in version related changes in the documentation 2020-01-21 03:47:56 -05:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
e91675291e Fix bug preventing movement of channels when there are gaps in position
The original code was too aggressive in ensuring that the channel
positions are correct and within bounds. Unfortunately, for Discord
this number is merely a guess and there can be gaps that cause the
position number to be greater than the number of channels currently
in that sorting bucket.

One such example of this is when a channel is deleted and created. When
this happens, the positions are not updated (presumably because Discord
considers this to be too expensive). Sadly this means that if a user
were to create a channel, delete a channel, and then create another one
then there will be gaps in the position sequence.

More concretely, consider the following example:

Channels with position [0, 1, 2, 3, 4]. A new channel is created so it
inherits the maximum position giving us [0, 1, 2, 3, 4, 5]. We delete
a channel that's smaller than the maximum so our list now looks like
[0, 1, 2, 4, 5]. Next time we create a channel we will further
increment the gap, giving us [0, 1, 2, 4, 5, 6]. If a user would want
to move the channel with position 4 to be after position 6 (so in this
case that value would 7) then the library would erroneously raise an
error because it assumed too much about the data integrity.

Luckily, the library upon actually doing the request fixes the channel
positions so everything goes back to normal like it was intended. That
is to say, [0, 1, 2, 3, 4, 5].
2020-01-12 03:27:48 -05:00
CapnS
072cef3bb6 Allow editing of overwrites in Channel.edit() 2019-12-04 18:40:38 -05:00
Devon R
f5ebf42e1f Return invites as https, various URL normalization 2019-11-15 04:25:38 -05:00
apple502j
7d7eabb974 Make permissions_synced actually return False
The code before this returned None when there is no category.
2019-08-27 17:43:33 -04:00
Rapptz
3dc9f40be7 Add versionadded string to GuildChannel.permissions_synced 2019-08-27 04:06:27 -04:00
Capn
125a5676b8 Add permissions_synced to abc.GuildChannel
This allows users to check whether or not the permissions for a Guild Channel are synced with the permissions for its category. Discord automatically syncs the permissions when the overwrites are equal so just checking if the two overwrites are equal will determine if they are synced.
2019-08-27 03:49:33 -04:00
Rapptz
87c2508199 Explicitly mention discord.Object in abc.Snowflake documentation. 2019-08-11 20:12:32 -04:00
Rapptz
cddcc6d6b6 abc.Messageable do not have to implement abc.Snowflake
Fix #2290
2019-07-27 22:38:30 -04:00
Rapptz
562580a07f Use lower level Guild.owner_id for permission resolution. 2019-07-10 14:30:53 -04:00
Xua
69364a25eb fix documentation for GuildChannel.set_permissions 2019-06-29 19:15:20 -04:00
Rapptz
7543328fe7 Update Sphinx to 2.1.2 2019-06-28 01:43:04 -04:00
Rapptz
7e2da1c93b Publicly expose a type property for all channels.
Fix #2185
2019-06-09 00:23:22 -04:00
NCPlayz
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
Rapptz
0d72ac3bb6 Ensure message links resolve in the Messageable.pins note. 2019-05-27 04:05:51 -04:00
Rapptz
96dc6f0c11 Add note that Messageable.pins does not contain Message.reactions
Fix for #2189
2019-05-27 04:04:06 -04:00
Ehren Julien-Neitzert
fc5a2936dd Fix pluralization errors in various files
* Replaced instances of 'return an' with 'returns an'
* fixed pluralization errors
2019-05-23 23:31:17 -04:00
DevilXD
0dcbdda974 Fixed a typo in GuildChannel.overwrites docstring 2019-04-29 23:34:18 -04:00