Commit Graph
27 Commits
Author SHA1 Message Date
Steve CandRapptz a9dba2753f [tasks] Move the Loop's sleep to be before exit conditions
This change makes it more so that `Loop.stop()` gracefully makes the
current iteration the final one, by waiting AND THEN returning.
The current implementation is closer to `cancel`, while also not.

I encountered this because I was trying to run a
`@tasks.loop(count=1)`, and inside it I print some text and change the
interval, and in an `after_loop`, I restart the loop.

Without this change, it immediately floods my console, due to
not waiting before executing `after_loop`.
2021-05-01 10:28:00 -04:00
Steve CandRapptz 4d47436b02 Fix guild.chunk() not working on evicted guilds
If you're trying to chunk a guild that the bot is not in, 
it'll just hang on the chunk coro forever. It's weird, I know.
2021-05-01 10:24:40 -04:00
Steve CandGitHub 7836046621 Mark User.avatar_url as attribute in Intents.members docstring
The line currently comes out to 
`User.avatar (User.avatar_url() and User.avatar_url_as())` 
but `User.avatar_url` is not callable.
2021-03-13 01:47:06 -05:00
Steve CandGitHub bde5bb5d5c Fix WebhookMessages docstrings
Silly danno
2020-12-10 23:32:22 -05:00
Steve CandGitHub 6e6a3bed1a Add created_at property to PartialEmoji
Also fixed docstring for PartialEmoji.url
2020-12-06 03:59:20 -05:00
Steve CandRapptz 128c9f4eb8 Use GuildChannel abc for CategoryChannel edit
I noticed nothing happened when I did
`ch.edit(overwrites=oh.overwrites)`

`http.edit_channel` doesn't do anything with the `overwrites` keyword,
it's processed as `permission_overwrites` instead which `self._edit`
takes care of.

I feel this was an oversight at some point.
2020-05-10 17:00:24 -04:00
Steve CandRapptz 4b3a7fbe16 [tasks] Allow Loop.cancel in Loop.before_loop
Task cancel raises on the next awaited coro, so I've added this 0-sleep "hack"

I'm internally debating if leaving the comment there, but I'm sure it would confuse the uninformed of this trick.
2020-05-10 17:00:23 -04:00
Steve CandRapptz 0fd5eca0d5 [tasks] Fix tasks decorators being discarded
At this moment, when a task seems to be first loaded, it immediately throws away the decorators you give it, and just generates a new instance of itself.

In your cog's `__init__`, once you do `self.my_task.start()`, the Loop is remade when it gets to `self.my_task` before executing the `start` function. The original Loop that the cog starts with is where the decorated values are. This fixes that.
2020-05-07 02:30:24 -04:00
Steve CandRapptz 5022aa5a0b Fix broken versionadded in Message.is_system() 2019-09-10 21:10:58 -04:00
DiceandRapptz da4bb0610c Add CHANNEL_FOLLOW_ADD Message Type
Add documentation for MessageType.channel_follow_add

Add versionchanged to new MessageType attr

Add system_content for new MessageType
2019-08-27 04:05:03 -04:00
Steve CandRapptz ae4989e474 Fix return type docstring for BaseUser.default_avatar 2019-07-18 18:06:26 -04:00
Steve CandRapptz 7cec42c8f1 Fix doc URL in Client.fetch_guild 2019-07-18 18:06:26 -04:00
Steve CandGitHub 8f111c521c Fix typo in Loop.restart documentation 2019-05-10 18:44:07 -04:00
Steve CandRapptz ac2cda1ffc [tasks] set internal task to None after canceling 2019-04-12 20:56:40 -04:00
Steve CandRapptz db340fd5f9 Fix broken documentation attribute 2019-04-09 00:10:28 -04:00
DiceandRapptz 8123d4a5f7 Add type checking to multi-file send
Convert list comprehension to genexpr
2019-03-20 09:22:08 -04:00
DiceandRapptz 6f3e32cfbb Fix sending multiple files
Fixes #2002
2019-03-20 09:21:16 -04:00
Steve CandGitHub 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
DiceandRapptz 33dc3411ac Fix Webhook states for stateful objects 2019-01-28 21:41:55 -05:00
DiceandRapptz bda690c32f [commands] Remove message being required from Role/Member converters.
This allows for easier "mock" context objects, for those who use
converters as utility functions outside of commands, and it's more
straightforward with the rest of the file.
2018-12-14 18:59:47 -05:00
DiceandRapptz 5a585ebf20 Add channel category cooldown bucket type 2018-11-24 22:51:18 -05:00
Steve CandRapptz 0e945915b7 Fixes various documentation errors/inconsistencies
Mostly dealing with permissions, also fixes Raw Events inclusion.
2018-05-18 20:25:54 -04:00
Steve CandGitHub 233c2d80ef Fix grammar in abc docs, add new implementation 2017-09-13 13:54:09 -04:00
Steve CandGitHub 221df0ab02 Update embed property doc grammar 2017-08-29 15:48:10 -04:00
Steve CandRapptz 4d421377e4 Fix on_guild_join param doc 2017-08-27 16:08:06 -04:00
Steve CandRapptz 5e2d915375 Add pinning to manage_messages doc 2017-08-27 16:08:06 -04:00
Steve CandRapptz 7ee5dc22fb Fix a couple docstrings 2017-08-22 04:45:52 -04:00