127 Commits

Author SHA1 Message Date
NCPlayz
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
Rapptz
2cd6d771ec Make __repr__ slightly more detailed and add a few missing ones.
This includes raw events (which didn't have any) and a few other
types that were missing them. Upon review some more useful fields were
added to the repr output which would be more useful during debugging.
2019-05-26 02:32:47 -04:00
Vexs
bf5b267c55 Correct the documentation for methods and properties that return Assets 2019-05-14 19:13:48 -04:00
DevilXD
b8e45afe9a Fixed TextChannel edit method missing slowmode unit 2019-04-29 23:34:17 -04:00
Rapptz
919dbcafb3 Consistent use of __all__ to prevent merge conflicts. 2019-04-20 17:20:58 -04:00
Rapptz
eb4de55f6d Add reason to TextChannel.create_webhook
The reason parameter does not work with webhook deletes or edits so
they're not added. Probably a Discord bug.
2019-04-18 22:31:55 -04:00
Rapptz
f5c38c3559 Add abc.GuildChannel.clone to clone a channel with another name.
Fixes #2093
2019-04-18 22:31:54 -04:00
Rapptz
812578f0c9 Remove legacy nsfw check. 2019-04-16 20:29:13 -04:00
Lorenzo
b969016340
Bool fix in TextChannel.purge documentation. 2019-04-13 15:27:20 +02:00
apple502j
024e57efc2
Change slowmode max value in docs 2019-04-13 18:56:53 +09:00
khazhyk
366dc4855b simplify HistoryIterator message ordering
rename reverse -> oldest_first, which is more obvious what it does.
Then, honor it entirely - if you specify no `after` endpoint, we default
to the beginning of message history, similar to how `before` defaults to
the end of message history.

This is a breaking change, and will change the behavior of any iterator
that previously would have been returning messages in a weird order for
limits over 100

`for msg in history(reversed=True, limit=300)` would return the newest
300 messages, in a messed up order (100..0, 200..100, 300..200).
`for msg in history(oldest_first=True, limit=300)` will now return the
oldest 300 messages in order. And so on.

`for msg in history(after=msg)` is unchanged, this previously would
return the oldest 100 messages after `msg`, oldest->newest order, and
still will.
2019-04-07 22:46:40 -07:00
NCPlayz
be227ebcf0 Redesign asset retrieval in the library.
Most assets now return a new class named `Asset`. This allows for the
assets to be consistently saved via a `save` method instead of special
casing for `Attachment`.

`AppInfo` is no longer a namedtuple it is a fully documented dataclass,
as well as having the state attached to it.

Fixes #1997
2019-04-06 19:12:50 -04:00
Capn
fd3a176793
Fix documentation for Channel.last_message 2019-03-22 10:31:19 -05:00
Rapptz
35c0476dbb Add TextChannel.last_message_id and TextChannel.last_message 2019-03-20 22:30:23 -04:00
NCPlayz
fb02191b80 Organise documentation 2019-03-19 08:24:42 -04:00
Rapptz
cb9ae7bd76 Sorting bucket requires an integer. 2019-03-17 15:16:46 -04:00
Rapptz
f3f2f882fd Fix typo in private property name. 2019-03-17 15:14:58 -04:00
Rapptz
5061915b2a Add support for store channels. 2019-03-17 14:32:51 -04:00
Rapptz
a70db36cfc Handle type updates in TextChannel._update for news channels. 2019-03-12 23:13:22 -04:00
Nadir Chowdhury
999ac0a0e3 Add Category.create_text_channel/Category.create_voice_channel (#1976)
Fixes #1971
2019-03-12 08:16:25 -04:00
Rapptz
5ea84fb971 Add support for guild news channels. 2019-03-08 21:40:43 -05:00
Steve C
8beabcc39a
Fix typing for Channel.purge's limit kwarg.
PyCharm was throwing a fit when I set it to None. 😒
2019-02-27 16:40:32 -05:00
Pedro Cunha
4ebe02ab1f Fix documentation typo in CategoryChannel 2019-02-12 19:15:21 -05:00
Chris
1222bce271 Add CategoryChannel.text_channels and voice_channels 2019-01-29 06:50:18 -05:00
Dante Dam
9656a21ebe Bumped copyright years to 2019. 2019-01-28 22:22:50 -05:00
Michael H
f45aef7c2e Handle implicit perms in discord.VoiceChannel.permissions_for
This adds some implicit permission handling for `discord.VoiceChannel.permissions_for`

This is not documented behavior in discord's developer documentation, but it can easily be verified as correct.
2018-12-14 18:59:46 -05:00
Hornwitser
efb4ff850e [lint] Fix import order
Reorder imports to be consistenly grouped by standard library, third
party library, and local modules in that order thoughout the library.
2018-11-24 22:17:58 -05:00
Rapptz
860d6a9ace Revert "Rework documentation to not duplicate inherited members."
This reverts commit 96981210b3415e15446db0b702b07fef25c8b680.
2018-10-11 03:42:01 -04:00
Rapptz
96981210b3 Rework documentation to not duplicate inherited members.
This will probably be reverted in 1 week.
2018-10-03 05:45:30 -04:00
Rapptz
5c24e69cf2 Fix up the Sphinx strings causing warnings. 2018-09-15 09:54:00 -04:00
Rapptz
0352c80a17 Add support for Discord's slow mode.
Adds the following:

* `slowmode_delay` for `TextChannel.edit`
* `slowmode_delay` attribute for `TextChannel`
2018-09-14 22:55:29 -04:00
BeatButton
a4d1599ce9 Change docstrings to raw-strings 2018-09-14 22:55:27 -04:00
Hornwitser
c557ee33ca [lint] Fix types used for __slots__ and __all__
Stay consistent with the rest of the library and use lists for module
__all__ values and tuples for class __slots__ attributes.
2018-08-22 21:43:55 -04:00
Hornwitser
c8b49d37be [lint] Fix incorrect and inconsistent whitespace
Adjust whitespace to be consistent with the rest of the library.
2018-08-22 21:43:53 -04:00
Rapptz
4aecdea052 Make TextChannel.create_webhook name parameter mandatory. 2018-07-20 04:17:28 -04:00
Rapptz
f25091efe1 Drop support for Python 3.4 and make minimum version 3.5.2. 2018-06-10 18:10:00 -04:00
Steve C
0e945915b7 Fixes various documentation errors/inconsistencies
Mostly dealing with permissions, also fixes Raw Events inclusion.
2018-05-18 20:25:54 -04:00
Rapptz
1590441dbf Fix typo in TextChannel.delete_messages documentation. 2018-03-06 00:19:58 -05:00
Jared Shields
2f562bd695
Update docstrings for channel.py
`delete_messages` requires `manage_messages`; the docs in here, nor on RTD reflect this. 
Small amendment at line 180, adding three additional.
2018-02-26 22:04:49 -08:00
Tobotimus
3112e1c17e Add intersphinx 2018-01-06 17:23:59 -05:00
Rapptz
89bbbec37e Missing name parameter in VoiceChannel.edit documentation. 2017-10-26 05:36:19 -04:00
Rapptz
53b4890435 Add category support.
This adds:

* CategoryChannel, which represents a category
* Guild.by_category() which traverses the channels grouping by category
* Guild.categories to get a list of categories
* abc.GuildChannel.category to get the category a channel belongs to
* sync_permissions keyword argument to abc.GuildChannel.edit to sync
  permissions with a pre-existing or new category
* category keyword argument to abc.GuildChannel.edit to move a channel
  to a category
2017-09-13 09:44:36 -04:00
Rapptz
37b0fdb898 Add webhook support.
Allows for usage of either `requests` and `aiohttp` when used in
"Standalone" mode.

Fixes #704
2017-08-21 01:57:07 -04:00
Rapptz
3b3b8a5150 Remove incorrect extraneous usage of reason keyword argument.
Fixes #726
2017-08-17 18:20:28 -04:00
Rapptz
63231ef033 Remove reason keyword argument from message deletion.
Apparently this is unsupported.

Affected functions include:

* abc.Messageable.send
* Message.delete
* TextChannel.delete_messages
* TextChannel.purge
2017-08-15 22:38:43 -04:00
khazhyk
f1e08cccac Add bulk argument to TextChannel.purge
bulk=False will never use bulk message delete. Useful e.g. for
using the purge interface for deleting the bot's own messages.
2017-07-24 00:11:05 -04:00
Rapptz
6e0902ef57 Implement new-style NSFW channels.
No idea how these will change in the future but this is barebones
enough for now.
2017-07-18 16:36:26 -04:00
Rapptz
3fbeb94cdb Expose reverse parameter in TextChannel.purge 2017-07-14 01:13:50 -04:00
Rapptz
ea078f1c68 Fix TextChannel.purge not working. 2017-07-04 21:59:44 -04:00
Rapptz
77f04539b1 Typo in docstring for TextChannel.delete_messages 2017-06-29 20:33:19 -04:00