mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-23 11:13:51 -05:00
Bump discord.py to 1.7.0 (#4928)
* Bump discord.py, but to the git version for now * Import GuildConverter from d.py and deprecate our implementation * Import PartialMessageConverter in our commands extension * Use newly added `Cog.has_error_handler()` rather than private method * Update snowflake regex to use 20 as max length See Rapptz/discord.py#6501 * Use new supported way for custom cooldown buckets * Include group args in command signature * Update code to use `Client.close()` over `Client.logout()` * Add StageChannelConverter and StoreChannelConverter * Fix AttributeError in licenseinfo
This commit is contained in:
@@ -181,7 +181,7 @@ async def _edit_prefix(red, prefix, no_prompt):
|
||||
|
||||
async def _edit_owner(red, owner, no_prompt):
|
||||
if owner:
|
||||
if not (15 <= len(str(owner)) <= 21):
|
||||
if not (15 <= len(str(owner)) <= 20):
|
||||
print(
|
||||
"The provided owner id doesn't look like a valid Discord user id."
|
||||
" Instance's owner will remain unchanged."
|
||||
@@ -199,7 +199,7 @@ async def _edit_owner(red, owner, no_prompt):
|
||||
print("Please enter a Discord user id for new owner:")
|
||||
while True:
|
||||
owner_id = input("> ").strip()
|
||||
if not (15 <= len(owner_id) <= 21 and owner_id.isdecimal()):
|
||||
if not (15 <= len(owner_id) <= 20 and owner_id.isdecimal()):
|
||||
print("That doesn't look like a valid Discord user id.")
|
||||
continue
|
||||
owner_id = int(owner_id)
|
||||
@@ -434,7 +434,7 @@ async def shutdown_handler(red, signal_type=None, exit_code=None):
|
||||
red._shutdown_mode = exit_code
|
||||
|
||||
try:
|
||||
await red.logout()
|
||||
await red.close()
|
||||
finally:
|
||||
# Then cancels all outstanding tasks other than ourselves
|
||||
pending = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
|
||||
|
||||
Reference in New Issue
Block a user