mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 09:56:05 -05:00
Remove provisional note from NoParseOptional, fix and start using UserInputOptional (#4142)
This commit is contained in:
@@ -10,6 +10,7 @@ from discord.embeds import EmptyEmbed
|
||||
from redbot.core.utils import AsyncIter
|
||||
|
||||
from redbot.core import commands
|
||||
from redbot.core.commands import UserInputOptional
|
||||
from redbot.core.utils.menus import DEFAULT_CONTROLS, close_menu, menu, next_page, prev_page
|
||||
|
||||
from ...audio_dataclasses import _PARTIALLY_SUPPORTED_MUSIC_EXT, Query
|
||||
@@ -122,7 +123,7 @@ class PlayerCommands(MixinMeta, metaclass=CompositeMetaClass):
|
||||
@commands.guild_only()
|
||||
@commands.bot_has_permissions(embed_links=True)
|
||||
async def command_bumpplay(
|
||||
self, ctx: commands.Context, play_now: Optional[bool] = False, *, query: str
|
||||
self, ctx: commands.Context, play_now: UserInputOptional[bool] = False, *, query: str
|
||||
):
|
||||
"""Force play a URL or search for a track."""
|
||||
query = Query.process_input(query, self.local_folder_current_path)
|
||||
|
||||
@@ -12,6 +12,7 @@ import lavalink
|
||||
from redbot.core.utils import AsyncIter
|
||||
|
||||
from redbot.core import commands
|
||||
from redbot.core.commands import UserInputOptional
|
||||
from redbot.core.data_manager import cog_data_path
|
||||
from redbot.core.utils.chat_formatting import bold, pagify
|
||||
from redbot.core.utils.menus import DEFAULT_CONTROLS, menu
|
||||
@@ -636,7 +637,7 @@ class PlaylistCommands(MixinMeta, metaclass=CompositeMetaClass):
|
||||
self,
|
||||
ctx: commands.Context,
|
||||
playlist_matches: PlaylistConverter,
|
||||
v2: Optional[bool] = False,
|
||||
v2: UserInputOptional[bool] = False,
|
||||
*,
|
||||
scope_data: ScopeParser = None,
|
||||
):
|
||||
|
||||
@@ -5,6 +5,7 @@ import aiohttp
|
||||
|
||||
from redbot.core.i18n import Translator, cog_i18n
|
||||
from redbot.core import checks, Config, commands
|
||||
from redbot.core.commands import UserInputOptional
|
||||
|
||||
_ = Translator("Image", __file__)
|
||||
|
||||
@@ -47,7 +48,7 @@ class Image(commands.Cog):
|
||||
pass
|
||||
|
||||
@_imgur.command(name="search")
|
||||
async def imgur_search(self, ctx, count: Optional[int] = 1, *, term: str):
|
||||
async def imgur_search(self, ctx, count: UserInputOptional[int] = 1, *, term: str):
|
||||
"""Search Imgur for the specified term.
|
||||
|
||||
Use `count` to choose how many images should be returned.
|
||||
|
||||
@@ -6,6 +6,7 @@ from typing import Optional, Union
|
||||
|
||||
import discord
|
||||
from redbot.core import commands, i18n, checks, modlog
|
||||
from redbot.core.commands import UserInputOptional
|
||||
from redbot.core.utils import AsyncIter
|
||||
from redbot.core.utils.chat_formatting import pagify, humanize_number, bold, humanize_list
|
||||
from redbot.core.utils.mod import is_allowed_by_hierarchy, get_audit_reason
|
||||
@@ -427,7 +428,7 @@ class KickBanMixin(MixinMeta):
|
||||
self,
|
||||
ctx: commands.Context,
|
||||
user: discord.Member,
|
||||
duration: Optional[commands.TimedeltaConverter] = timedelta(days=1),
|
||||
duration: UserInputOptional[commands.TimedeltaConverter] = timedelta(days=1),
|
||||
days: Optional[int] = None,
|
||||
*,
|
||||
reason: str = None,
|
||||
|
||||
@@ -14,6 +14,7 @@ from redbot.cogs.warnings.helpers import (
|
||||
)
|
||||
from redbot.core import Config, checks, commands, modlog
|
||||
from redbot.core.bot import Red
|
||||
from redbot.core.commands import UserInputOptional
|
||||
from redbot.core.i18n import Translator, cog_i18n
|
||||
from redbot.core.utils import AsyncIter
|
||||
from redbot.core.utils.chat_formatting import warning, pagify
|
||||
@@ -364,7 +365,7 @@ class Warnings(commands.Cog):
|
||||
self,
|
||||
ctx: commands.Context,
|
||||
user: discord.Member,
|
||||
points: Optional[int] = 1,
|
||||
points: UserInputOptional[int] = 1,
|
||||
*,
|
||||
reason: str,
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user