From ff8bf341c438858752e6fab2219057057edfa470 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 10 Aug 2023 22:22:46 -0400 Subject: [PATCH] misc: simplified export method --- exportchannels/exportchannels.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/exportchannels/exportchannels.py b/exportchannels/exportchannels.py index 3437ce2..49f2ceb 100644 --- a/exportchannels/exportchannels.py +++ b/exportchannels/exportchannels.py @@ -15,10 +15,12 @@ class ExportChannels(commands.Cog): ) - def export(self, ctx, channel, token): + async def export(self, channels: list): + token = await self.config.bot_token() self.data_path = data_manager.cog_data_path(self) self.bundled_data_path = data_manager.bundled_data_path(self) out = f'{self.data_path}{os.sep}Exported Channels' + channel = channels[0] try: os.mkdir(out) except FileExistsError: @@ -34,8 +36,6 @@ class ExportChannels(commands.Cog): '--media', '--fuck_russia', 'true', ] - if bot: - args += '--bot' os.chdir(self.bundled_data_path) subprocess.call(args) args = [ @@ -45,13 +45,11 @@ class ExportChannels(commands.Cog): '--format', 'Json', '--output', f'/{out}/%G (%g)/%C (%c)/DCE-f.json', '--token', f'{token}', - '--channel', {channel}, + '--channel', {channels}, '--reuse_media', '--media', '--fuck_russia', 'true', ] - if bot: - args += '--bot' os.chdir(self.bundled_data_path) subprocess.call(args)