Tyrrrz / DiscordChatExporter

Exports Discord chat logs to a file
MIT License
7.68k stars 701 forks source link

Get channels by category ID #798

Closed p-i- closed 1 year ago

p-i- commented 2 years ago

Flavor

CLI

Export format

All

Details

For a particular guild, I wish to export all channels within a particular category. It would be nice if the --filter option were to be extended so that one can filter on category-id 🙏

96-LB commented 2 years ago

This would make more sense as a command, no? I'm thinking something like exportcategory -c <category-id>. The --filter option is more for filtering out individual messages rather than entire channels.

Tyrrrz commented 2 years ago

Yeah I'm thinking maybe we should extend the guild command with an option to filter the output by category. That way the user can get the list of channels they're interested in and copy-paste it.

96-LB commented 2 years ago

Alternatively, maybe we could allow the export command to take channel categories as inputs. This allows users to take advantage of the feature even if they want to export individuals channels alongside entire categories without making two calls or resorting to listing everything out.

Tyrrrz commented 2 years ago

Alternatively, maybe we could allow the export command to take channel categories as inputs. This allows users to take advantage of the feature even if they want to export individuals channels alongside entire categories without making two calls or resorting to listing everything out.

That's a really good idea

p-i- commented 2 years ago

Is it possible to just pass in an id which might be a guild-id, a category-id or a channel-id (or even a message-id) and the scraper could act accordingly?

Is that what @96-LB is suggesting?

That would sure make for a tidy minimal API.

The output file could be interpreted as a file for channel/msg level scrapes and a folder for category/guild level scrapes.

96-LB commented 2 years ago

Is it possible to just pass in an id which might be a guild-id, a category-id or a channel-id (or even a message-id) and the scraper could act accordingly?

Unfortunately, guilds can have the same ID as one of their channels. I thought I went crazy because I remembered this being a thing yet couldn't replicate it, so I did some digging and found out that it's just a very old feature. When Discord removed this, they stated that "existing guilds will not have their #general channel id changed", so there can still be duplicate IDs out there. I did manage to find one in a very old server of mine.

I do think it would be nice to consolidate guilds into the export command too, but this does complicate things a little and might require some workaround to be implemented if it were to happen.

Tyrrrz commented 2 years ago

Yeah the original API only had the export command and then the features started piling up. We need to clean it up eventually.