no longer load extension if upload disabled
This commit is contained in:
parent
123ff9c4ae
commit
e906b9da1d
1 changed files with 91 additions and 92 deletions
|
|
@ -11,7 +11,6 @@ class PhixxyCom(commands.Cog):
|
|||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.upload_enabled = os.getenv('upload_phixxy')
|
||||
self.SERVER = os.getenv('ftp_server')
|
||||
self.USERNAME = os.getenv('ftp_username')
|
||||
self.PASSWORD = os.getenv('ftp_password')
|
||||
|
|
@ -46,7 +45,6 @@ class PhixxyCom(commands.Cog):
|
|||
return "Unknown Prompt"
|
||||
|
||||
async def upload_sftp(self, local_filename, server_folder, server_filename):
|
||||
if self.upload_enabled.lower() == "true":
|
||||
remotepath = server_folder + server_filename
|
||||
async with asyncssh.connect(self.SERVER, username=self.USERNAME, password=self.PASSWORD) as conn:
|
||||
async with conn.start_sftp_client() as sftp:
|
||||
|
|
@ -158,7 +156,6 @@ class PhixxyCom(commands.Cog):
|
|||
|
||||
async def upload_ftp_ai_images(self, ai_dict):
|
||||
try:
|
||||
if self.upload_enabled.lower() == "true":
|
||||
for folder in ai_dict:
|
||||
for filename in os.listdir(folder):
|
||||
if filename[-4:] == '.png':
|
||||
|
|
@ -235,7 +232,6 @@ class PhixxyCom(commands.Cog):
|
|||
return last_5_messages
|
||||
|
||||
async def generate_blog(self):
|
||||
if True:#self.upload_enabled.lower() == "true":
|
||||
start_time = time.time()
|
||||
topic = ''
|
||||
filename = f"{self.data_dir}ai-blog/index.html"
|
||||
|
|
@ -371,6 +367,9 @@ class PhixxyCom(commands.Cog):
|
|||
await ctx.send(output)
|
||||
|
||||
async def setup(bot):
|
||||
if os.getenv("upload_phixxy") == "true":
|
||||
asyncssh.set_log_level(30)
|
||||
asyncssh.set_sftp_log_level(30)
|
||||
await bot.add_cog(PhixxyCom(bot))
|
||||
else:
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue