BilliAlpha / discord-transfer

A discord bot for copying messages between guilds
26 stars 0 forks source link

Feature Request: "--include-channel" option #24

Closed IronPegasus closed 7 months ago

IronPegasus commented 9 months ago

Sometimes, I want to migrate a singular channel from a category that that has 10+ channels in it. The existing --skip-channel option works great, but it's a bit tedious to specify the 9+ channels I don't want to migrate. It would be convenient if instead there was an --include-channel option that was mutually exclusive with the --skip-channel option that allowed me to specify just the one channel I wanted.

GarretSidzaka commented 7 months ago

should be marked as a bug, not a feature request

originating launch script:



export DISCORD_TOKEN="redacted"

#Example: `java -jar discord-transfer.jar migrate 123456789 987654321 --skip-channel 741852963`

/opt/java/openjdk/bin/java -jar /root/discord-transfer-3.0.2.jar -v migrate redacted redacted --skip-channel \
"946393256273534986 697605207995056190 614163169409105935 561993839393505281 \
754858627780837416 649760699589066752 587854154051878941 1140758993975918662 \
828769778898042970 592422508112904202 588548197689982989 1187537502815404122 \
586688203038130176 1174845757313011773 1015856083820085310 1187537052745609297 \
1162881954341998633 1006332254315884654 1015422738539745340 830718950865764382 \
830718950865764382 830718950865764382 830718979210870785 586956327142686720 \
755088790632267987 794660618635313162 829205513283043348 836090621508845658 \
597288220400680971"

b23af047215f:~# ./transfer.sh
2024-01-16 16:28:35 DEBUG com.billialpha.discord.transfer.DiscordTransfer - Debug logging enabled!
Too many arguments, expected 2 got 30: 697605207995056190
See 'help' action for help
com.billialpha.discord.transfer.Parameters$ParameterException: Too many arguments, expected 2 got 30: 697605207995056190
        at com.billialpha.discord.transfer.Parameters.parse(Parameters.java:214)
        at com.billialpha.discord.transfer.Parameters.parse(Parameters.java:144)
        at com.billialpha.discord.transfer.DiscordTransfer.main(DiscordTransfer.java:82)
b23af047215f:~# vi transfer.sh
b23af047215f:~# vi transfer.sh
b23af047215f:~# ./transfer.sh
2024-01-16 16:32:03 DEBUG com.billialpha.discord.transfer.DiscordTransfer - Debug logging enabled!
Invalid value for parameter skip-channel: NumberFormatException: Error at index 18 in: "946393256273534986 697605207995056190 614163169409105935 561993839393505281 754858627780837416 649760699589066752 587854154051878941 1140758993975918662 828769778898042970 592422508112904202 588548197689982989 1187537502815404122 586688203038130176 1174845757313011773 1015856083820085310 1187537052745609297 1162881954341998633 1006332254315884654 1015422738539745340 830718950865764382 830718950865764382 830718950865764382 830718979210870785 586956327142686720 755088790632267987 794660618635313162 829205513283043348 836090621508845658 59728822040068097"
See 'help' action for help
com.billialpha.discord.transfer.Parameters$ParameterException: Invalid value for parameter skip-channel: NumberFormatException: Error at index 18 in: "946393256273534986 697605207995056190 614163169409105935 561993839393505281 754858627780837416 649760699589066752 587854154051878941 1140758993975918662 828769778898042970 592422508112904202 588548197689982989 1187537502815404122 586688203038130176 1174845757313011773 1015856083820085310 1187537052745609297 1162881954341998633 1006332254315884654 1015422738539745340 830718950865764382 830718950865764382 830718950865764382 830718979210870785 586956327142686720 755088790632267987 794660618635313162 829205513283043348 836090621508845658 59728822040068097"
        at com.billialpha.discord.transfer.Parameters.updateParamValue(Parameters.java:238)
        at com.billialpha.discord.transfer.Parameters.parse(Parameters.java:180)
        at com.billialpha.discord.transfer.Parameters.parse(Parameters.java:144)
        at com.billialpha.discord.transfer.DiscordTransfer.main(DiscordTransfer.java:82)```
GarretSidzaka commented 7 months ago

without the skips


b23af047215f:~# ./transfer.sh
2024-01-16 16:38:43 DEBUG com.billialpha.discord.transfer.DiscordTransfer - Debug logging enabled!
2024-01-16 16:38:44 DEBUG com.billialpha.discord.transfer.DiscordTransfer - Logging in ...
2024-01-16 16:38:47 INFO  com.billialpha.discord.transfer.DiscordTransfer - Logged in, user: migration bot
2024-01-16 16:38:47 INFO  com.billialpha.discord.transfer.commands.MigrateCommand - Loaded source guild: discord_server_foo (redacted)
2024-01-16 16:38:47 INFO  com.billialpha.discord.transfer.commands.MigrateCommand - Loaded destination guild: discord_server_bar (redacted)
2024-01-16 16:38:47 INFO  com.billialpha.discord.transfer.commands.MigrateCommand - Starting migration ...
2024-01-16 16:38:47 INFO  com.billialpha.discord.transfer.commands.MigrateCommand - Migration finished without migrating any message
2024-01-16 16:38:47 DEBUG com.billialpha.discord.transfer.commands.MigrateCommand - Logged out
BilliAlpha commented 7 months ago

@GarretSidzaka It is a feature request, please open a different issue for your problem. While I'm at it, your problem comes from an invalid syntax, you have to specify --skip-channel as many times as there are channels to skip, and you should not quote the list of channels

BilliAlpha commented 7 months ago

Feature added in v3.1.0