mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[V3 Downloader] Allow for requiring minimum python version (#1455)
This commit is contained in:
@@ -5,6 +5,8 @@ from sys import path as syspath
|
||||
from typing import Tuple, Union
|
||||
|
||||
import discord
|
||||
import sys
|
||||
|
||||
from redbot.core import Config
|
||||
from redbot.core import checks
|
||||
from redbot.core.data_manager import cog_data_path
|
||||
@@ -275,6 +277,13 @@ class Downloader:
|
||||
await ctx.send(_("Error, there is no cog by the name of"
|
||||
" `{}` in the `{}` repo.").format(cog_name, repo_name.name))
|
||||
return
|
||||
elif cog.min_python_version > sys.version_info:
|
||||
await ctx.send(_(
|
||||
"This cog requires at least python version {}, aborting install.".format(
|
||||
'.'.join([str(n) for n in cog.min_python_version])
|
||||
)
|
||||
))
|
||||
return
|
||||
|
||||
if not await repo_name.install_requirements(cog, self.LIB_PATH):
|
||||
await ctx.send(_("Failed to install the required libraries for"
|
||||
|
||||
Reference in New Issue
Block a user