mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
Add information on how to update to out of date message (#3744)
* add a more detailed update help Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * ... Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * a bit more clarity Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * sure thing Jack Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * add a disclaimer to the update command saying if the user faces any difficulties to check the system appropriate docs and/or support server Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * add translation support Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * better translation support for these Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Update redbot/core/events.py Co-Authored-By: Flame442 <34169552+Flame442@users.noreply.github.com> * Apply suggestions from code review Co-Authored-By: Flame442 <34169552+Flame442@users.noreply.github.com> * review Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Revert black fuckery Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * aaaaaaaaaaaaaaaaaaaaaaaaaaa Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * address jacks review Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * black Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * Update redbot/core/events.py * Update redbot/core/events.py Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * Update redbot/core/utils/_internal_utils.py Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,7 @@ from typing import (
|
||||
)
|
||||
|
||||
import discord
|
||||
import pkg_resources
|
||||
from fuzzywuzzy import fuzz, process
|
||||
|
||||
from redbot.core import data_manager
|
||||
@@ -33,7 +34,15 @@ if TYPE_CHECKING:
|
||||
|
||||
main_log = logging.getLogger("red")
|
||||
|
||||
__all__ = ("safe_delete", "fuzzy_command_search", "format_fuzzy_results", "create_backup")
|
||||
__all__ = (
|
||||
"safe_delete",
|
||||
"fuzzy_command_search",
|
||||
"format_fuzzy_results",
|
||||
"create_backup",
|
||||
"send_to_owners_with_preprocessor",
|
||||
"send_to_owners_with_prefix_replaced",
|
||||
"expected_version",
|
||||
)
|
||||
|
||||
|
||||
def safe_delete(pth: Path):
|
||||
@@ -282,3 +291,8 @@ async def send_to_owners_with_prefix_replaced(bot: Red, content: str, **kwargs):
|
||||
return content.replace("[p]", prefix)
|
||||
|
||||
await send_to_owners_with_preprocessor(bot, content, content_preprocessor=preprocessor)
|
||||
|
||||
|
||||
def expected_version(current: str, expected: str) -> bool:
|
||||
# `pkg_resources` needs a regular requirement string, so "x" serves as requirement's name here
|
||||
return current in pkg_resources.Requirement.parse(f"x{expected}")
|
||||
|
||||
Reference in New Issue
Block a user