fix: updated exportchannel command for dpy 2.0

This commit is contained in:
Seaswimmer 2023-08-10 22:23:09 -04:00
parent ff8bf341c4
commit eddf871203
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -75,12 +75,14 @@ class ExportChannels(commands.Cog):
@commands.command() @commands.command()
@commands.admin() @commands.admin()
async def exportchannel(self, ctx, channel: discord.Channel): async def exportchannel(self, ctx, channel: discord.TextChannel):
"""Exports a channel using Discord Chat Exporter.""" """Exports a channel using Discord Chat Exporter."""
token = await self.config.bot_token token = await self.config.bot_token()
dce_install = data_manager.bundled_data_path(self) dce_install = data_manager.bundled_data_path(self)
if token == 0: if token is None:
await ctx.send(content="Please set your token with the ``exportset token`` command!") await ctx.send(content=f"Please set your token with the ``{ctx.prefix}exportset token`` command!")
return return
else: else:
await self.export(channel.id, token) id_list = [thread.id for thread in channel.threads]
id_list.insert(0, channel.id)
await self.export(id_list)