Coder Social home page Coder Social logo

discord-transfer's Introduction

discord-transfer

A discord bot for copying messages between guilds

build

Current version: v3.1.0

How to use ?

Download the JAR from the releases page.

Pre-requisites

Discord bot token

  1. Create an application on Discord's developer portal: https://discord.com/developers/applications/
  2. Create a bot for this application
  3. Enable the MESSAGE CONTENT privileged gateway intent.
  4. Copy the bot token and pass it to the application via the DISCORD_TOKEN environment variable

Invite the bot in guilds

In order for the bot to migrate messages it needs to be invited in both the source and destination guild, to do so you can use the following URL by replacing in your application ID (which can be found on the Discord developer portal)

https://discord.com/oauth2/authorize?client_id=<CLIENT-ID>&scope=bot

Launching

Pass the Discord bot token via environment variables.

  • On linux and macOS open a terminal (bash) and simply prefix your command with the token as such:
DISCORD_TOKEN="MY_TOKEN_HERE" java -jar discord-transfer.jar [arguments...]
  • On Windows you can use powershell. Define your environment variable and then run the program:
$env:DISCORD_TOKEN="MY_BOT_TOKEN_HERE"
java -jar discord-transfer.jar [arguments...]

The bot behaviour depends on the action you select.

java -jar discord-transfer.jar <action> [options...] [arguments...]

In most cases you'll probably want to use the migrate action to transfer messages, but there is also the clean action that removes the reactions used to mark migrated messages

migrate action

java -jar discord-transfer.jar migrate [options...] <source> <destination>

The migrate action takes 2 arguments:

  1. The Discord ID (Snowflake) of the source Guild (the one you want to copy messages from)
  2. The Discord ID of the destination Guild (the one in which messages will be copied)

There are also options to customize the migration behavior:

  • --include-channel: Specify channels that should be migrated, it's category will automatically be created if missing, expects a Discord channel ID
  • --category: Specify specific channel categories to migrate, expects a Discord category ID
  • --skip-channel: Specify channels that should not be migrated, expects a Discord channel ID
  • --text-only: Will only migrate text channels (skips voice channel creation)
  • --after: Only migrate messages after the give date (format ISO-8601, ex: 1997−07−16T19:20:30,451Z)
  • --delay: Add a delay between each message migration

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

clean action

java -jar discord-transfer.jar clean [options...] <server>

The clean action takes a single argument, the Discord ID (Snowflake) of the Guild you want to clean reactions from.

More info ?

If this README does not provide the information you are looking for, try running the help action.

About

This bot uses Discord4J as a bot library.

discord-transfer's People

Contributors

billialpha avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discord-transfer's Issues

Thread Functionality

Out of curiosity: do you plan to update this tool at any point to be able to export threads as well? This tool is incredibly useful for archiving channels in servers where old channels are no longer used, but viewing the old channels is still desired - but since threads were added after your most recent update, it doesn't recognize them at all.

Feature Request: "--include-channel" option

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.

Feature Request: Start Date Argument

Fully migrating channels with an extensive message history (100,000+ messages) can take several days to complete. Sometimes, the bot will terminate partway through the migration process with "connection closed" errors. This isn't a big deal since the bot flags migrated messages with a reaction and will pickup where it left off once restarted. However, it seems to start its scan for unflagged messages at the beginning of each channel's history, meaning that sometimes it will scan tens of thousands of messages just to reach where it died. It would be nice if there was an optional --startdate/--date/etc parameter that would allow specification of where the bot should start scanning for messages.

Error: Source was empty

Getting an error when I tried to migrate. Here's the stack trace. I'm sure the source was not empty, there are valid categories and channels that exist so I'm not sure why it's giving that error.

2021-01-28 21:10:55 INFO  com.billialpha.discord.transfer.DiscordTransfer - Start action 'migrate'
2021-01-28 21:10:55 INFO  com.billialpha.discord.transfer.DiscordTransfer - Starting migration ...
2021-01-28 21:10:55 INFO  com.billialpha.discord.transfer.DiscordTransfer - Migrating category: Investing
2021-01-28 21:10:55 WARN  com.billialpha.discord.transfer.DiscordTransfer - Error in channel migration
java.util.NoSuchElementException: Source was empty
        at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:165)
        at reactor.core.publisher.FluxFilter$FilterSubscriber.onComplete(FluxFilter.java:160)
        at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:262)
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onComplete(FluxFilter.java:293)
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onComplete(FluxFilter.java:293)
        at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:262)
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onComplete(FluxFilter.java:293)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onComplete(MonoFlatMapMany.java:252)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:78)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onComplete(MonoFlatMapMany.java:252)
        at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
        at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:136)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:838)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:600)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:580)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:457)
        at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:289)
        at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:363)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:188)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2344)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribe(MonoFlatMapMany.java:134)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:188)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2344)
        at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:155)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2152)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2026)
        at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:86)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
        at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128)
        at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418)
        at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:107)
        at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:240)
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:240)
        at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:240)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:242)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:242)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:704)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:580)
        at reactor.core.publisher.FluxFlatMap$FlatMapInner.onSubscribe(FluxFlatMap.java:970)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418)
        at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:267)
        at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:363)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:188)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2344)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribe(MonoFlatMapMany.java:134)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:188)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2344)
        at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:155)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2152)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2026)
        at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:86)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:207)
        at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:80)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2344)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2152)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2026)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8325)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:107)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmit(FluxFlatMap.java:535)
        at reactor.core.publisher.FluxFlatMap$FlatMapInner.onNext(FluxFlatMap.java:999)
        at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:107)
        at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2344)
        at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:155)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2152)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2026)
        at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:86)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418)
        at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:267)
        at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:363)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86)
        at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
        at reactor.core.publisher.Mono.block(Mono.java:1679)
        at com.billialpha.discord.transfer.DiscordTransfer.migrate(DiscordTransfer.java:136)
        at java.base/java.lang.Thread.run(Thread.java:832)
2021-01-28 21:10:55 INFO  com.billialpha.discord.transfer.DiscordTransfer - Migration finished successfully (0 messages)
2021-01-28 21:10:55 INFO  com.billialpha.discord.transfer.DiscordTransfer - Logged out

Error: 404 Not Found with response {code=10004, message=Unknown Guild}

2023-02-19 22:00:40 INFO com.billialpha.discord.transfer.DiscordTransfer - Logging in ...
2023-02-19 22:00:44 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged in, user: linabot#3985
Exception in thread "main" discord4j.rest.http.client.ClientException: GET /guilds/977548199264911361 returned 404 Not Found with response {code=10004, message=Unknown Guild}
at discord4j.rest.http.client.ClientResponse.clientException(ClientResponse.java:171)
Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below:
Error has been observed at the following site(s):
*__checkpoint ? Request to GET /guilds/977548199264911361 [RequestStream]
*__checkpoint ? Request to GET /guilds/977548199264911361 [DefaultRouter]
Original Stack Trace:
at discord4j.rest.http.client.ClientResponse.clientException(ClientResponse.java:171)
at discord4j.rest.http.client.ClientResponse.lambda$createException$13(ClientResponse.java:149)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:126)
at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:220)
at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:130)
at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:191)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:128)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:400)
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:419)
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:473)
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:703)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1373)
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1236)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1285)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:1589)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
at reactor.core.publisher.Mono.block(Mono.java:1707)
at com.billialpha.discord.transfer.DiscordTransfer.(DiscordTransfer.java:76)
at com.billialpha.discord.transfer.DiscordTransfer.main(DiscordTransfer.java:398)

java.lang.UnsupportedOperationException error when trying to migrate channels on server with a forum channel

I'm trying to migrate some old channels from one server to another. The channel category that I would like to migrate is pretty simple: it has 3 unique text channels and none of those channels have any threads. Elsewhere on the server, in a totally different channel category, we have one forum channel. When I run the migrate command, I get the following error:

java.lang.UnsupportedOperationException: Unknown Value: ChannelData{id=1027017741011525772, type=15, guildId=Possible{153767654270697473}, position=Possible{181}, permissionOverwrites=[OverwriteData{id=1017145521091133590, type=role, allow=3072, deny=0}, OverwriteData{id=193554506280206336, type=role, allow=3072, deny=0}, OverwriteData{id=1017145414933299330, type=role, allow=3072, deny=0}, OverwriteData{id=153767654270697473, type=role, allow=0, deny=1051648}], name=Possible{healer-forum-rp}, topic=Possible{Optional.empty}, nsfw=Possible{false}, lastMessageId=Possible{Optional[1035459503480639558]}, bitrate=Possible.absent, userLimit=Possible.absent, rateLimitPerUser=Possible{0}, recipients=null, icon=Possible.absent, ownerId=Possible.absent, applicationId=Possible.absent, parentId=Possible{Optional[1017143577773609011]}, lastPinTimestamp=Possible.absent, rtcRegion=Possible.absent, videoQualityMode=Possible.absent}
        at discord4j.core.util.EntityUtil.throwUnsupportedDiscordValue(EntityUtil.java:78)
        at discord4j.core.util.EntityUtil.getChannel(EntityUtil.java:65)
        at discord4j.core.retriever.StoreEntityRetriever.lambda$getGuildChannels$18(StoreEntityRetriever.java:127)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:705)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:581)
        at reactor.core.publisher.FluxFlatMap$FlatMapInner.onSubscribe(FluxFlatMap.java:948)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Mono.subscribe(Mono.java:4252)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:419)
        at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:267)
        at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:364)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161)
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8358)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:188)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2393)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribe(MonoFlatMapMany.java:134)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8358)
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:188)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2393)
        at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:155)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2190)
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2064)
        at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:86)
        at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8358)
        at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:207)
        at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:80)
        at reactor.core.publisher.Flux.subscribe(Flux.java:8358)
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:419)
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114)
        at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run(MonoPublishOn.java:178)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)

While I'm not 100% certain and don't have a secondary server to test with, I suspect that the forum channel is the issue because it's called out in by name in the name=Possible{healer-forum-rp} element and forum channels are a relatively new feature overall.

how to add the discord token

g'evening!

"Copy the bot token and pass it to the application via the DISCORD_TOKEN environment variable"

the question is - HOW?

when trying to run this program in the console, there is no prompt asking to input the value that would be ascribed to that "token" variable.
inside the code, that variable does not have a setter in the code.
inputting the token's value as a hard coded variable value also does not work because token is a string, and assigning a long set of numbers that is the discord token directly to it leads to a parsing error "java.lang.NumberFormatException: For input string: "?N8?N??^x?v??"".
you have previously mentioned to use $env:DISCORD_TOKEN="MY_BOT_TOKEN_HERE" prior to writing the terminal command java -jar [...] but this $env: line is not a valid terminal command, see below:

image

i tried running the jar - doesnt work, says unsupported binary file. i tried opening in JDK, also no success. tweaking the java file by hardcoding the token value there and exporting to jar does not work either.

when the app did not work, it said to type "help" for help, but that's also wrong because help is not a correct terminal command, and when this program runs in the JDK console, it is "read only" so you can't type anything (i.e. "help") to get any help.

what was the design idea, how is this supposed to work with this variable value insertion? how could i make it work? or is it perhaps designed to only work on linux and that's it?

A small tutorial would be nice!

Hi,
I have seen this project (?) and I want to use it on my servers. But I have no experience with Java before. So a short tutorial in the readme would be very helpful.
Thanks!

messages no longer copy after toggle on the message content intent to "on"

hello

so previously the messages all copied, but empty (all info BUT the message itself was copied - empty messages, just timestamps and nicknames), to which you advised to set the "message content intent" toggle in bot settings to "on":

image

this however makes the messages just to stop being copied at all:

image

what else could i be doing wrong here?

Migration finished successfully (0 messages)

Hi, Amazing app, I'm trying to migrate a server and this is just what I needed!ç
I'm getting the message "Migration finished successfully (0 messages)" even though the channels in my source Discord server are not empy. Here is the log I get, Please note I removed all private information before pasting it here:
JAVA -jar .\discord-transfer-2.0.2.jar migrate **SOURCE** *DESTINATION* 2022-01-19 13:16:20 INFO com.billialpha.discord.transfer.DiscordTransfer - Logging in ... 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged in, user: **MYBOT** 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Loaded source guild: **NAME (ID)** 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Loaded dest guild: **NAME (ID)** 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Start action 'migrate' 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Starting migration ... 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Migration finished successfully (0 messages) 2022-01-19 13:16:22 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged out

Any thoughts? thanks in advance

Include Hour/Minute timestamps

First of all, thank you for the bot!

This is a small feature request. For the sake of archiving a server of ours, I'd also like to see the HH:MM timestamp as well aside from the date.

Failing Link in Usernames for Transferred Messages

When the bot transfers messages from one server to another, the usernames on the messages are clickable links - but when clicking them, I receive a "You don't have access to this link" message.

Do you know why this might be, or what the link is supposed to direct to?

Where to import the Discord token?

Hi, don't really know where to import the bot token. When I run the code it says "MISSING DISCORD_TOKEN Could you please give me some assistance? Thanks

java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread parallel-3

I'm getting this:

2022-12-20 14:04:50 INFO  com.billialpha.discord.transfer.DiscordTransfer - Logging in ...
2022-12-20 14:04:51 INFO  com.billialpha.discord.transfer.DiscordTransfer - Logged in, user: ...
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Loaded source guild: ...
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Loaded dest guild: ...
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Start action 'migrate'
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Starting migration ...
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Migrating category: ...
2022-12-20 14:04:52 WARN  com.billialpha.discord.transfer.DiscordTransfer - Error in category migration
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread parallel-3
	at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83)
	at reactor.core.publisher.Flux.blockFirst(Flux.java:2600)
	at com.billialpha.discord.transfer.DiscordTransfer.lambda$migrateCategoryVoiceChannels$12(DiscordTransfer.java:195)
	at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:99)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:220)
	at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:247)
	at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:247)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:220)
	at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:247)
	at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)
	at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:113)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:220)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmitScalar(FluxFlatMap.java:488)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:421)
	at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:272)
	at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:230)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:371)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:165)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:109)
	at reactor.core.publisher.MonoFlattenIterable.subscribeOrReturn(MonoFlattenIterable.java:79)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8455)
	at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:195)
	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)
	at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:169)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:169)
	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2194)
	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2068)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
	at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4400)
	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263)
	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4400)
	at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:195)
	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74)
	at reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2664)
	at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)
	at reactor.core.publisher.FluxFilter$FilterSubscriber.onComplete(FluxFilter.java:166)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:269)
	at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onComplete(FluxFilter.java:300)
	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:85)
	at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
	at reactor.core.publisher.FluxFilter$FilterSubscriber.onComplete(FluxFilter.java:166)
	at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:269)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:846)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:608)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:588)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onComplete(FluxFlatMap.java:465)
	at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:294)
	at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:230)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:371)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:165)
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:109)
	at reactor.core.publisher.MonoFlattenIterable.subscribeOrReturn(MonoFlattenIterable.java:79)
	at reactor.core.publisher.Flux.subscribe(Flux.java:8455)
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:426)
	at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:440)
	at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:527)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Migration finished successfully (null messages)
2022-12-20 14:04:52 INFO  com.billialpha.discord.transfer.DiscordTransfer - Logged out
$ java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)

Help running the bot + UnsupportedClassVersionError

Trying to move over a category of channels to a new server I just made, should I make channels before I hit enter, this was done in version 2.2.2, I tried to hit enter without making channels and this has popped-up:

$env:DISCORD_TOKEN=MTEyNjY0MDM4ODIzMzQ5ODcyNA.GobJlA.mcWDaDoqbDzM6DX17vP9UmJ_blEZmlbIr7P3Lc
MTEyNjY0MDM4ODIzMzQ5ODcyNA.GobJlA.mcWDaDoqbDzM6DX17vP9UmJ_blEZmlbIr7P3Lc : The term
'MTEyNjY0MDM4ODIzMzQ5ODcyNA.GobJlA.mcWDaDoqbDzM6DX17vP9UmJ_blEZmlbIr7P3Lc' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:20
+ ... SCORD_TOKEN=MTEyNjY0MDM4ODIzMzQ5ODcyNA.GobJlA.mcWDaDoqbDzM6DX17vP9UmJ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MTEyNjY0MDM4ODI..._blEZmlbIr7P3Lc:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\<USERS>> java -jar discord-transfer.jar migrate clean 651934270360649737 1126639731145445518 --category 911044132888248331 --skip 911045729945018369 --skip 996245243273945148 --skip 974307876749332490 --skip 1122281850090561566 --skip 984207408958160906 --skip 979471633062445096 --skip 911061839398453299 --skip 982631108539727922 --skip 977901213343432784 --skip 962740757150720020 --skip 932685734031261706 --skip 974745520654397481 --skip 1125503645161619467 --skip 911088614123900978 --skip 929825221530247248 --skip 931211133908582440 --skip 931720536021696522 --skip 933374547820965898 --skip 941174372020924476 --skip 941901737315418132 --skip 943699421554679808 --skip 953756174250037258 --skip 957822225812168744 --skip 960931014354542663 --skip 968525816591962173 --skip 980262800184209528 --skip 980887993265029160 --skip 1001549755731689533 --skip 1012467542876508300 --skip 1043704598705209365 --skip 1049331321664700577 --skip 1087191050885533706 --skip 1097321297362550805 --skip 1104562954784997446 --skip 1106071585225445467 --skip 1106430909500117103
Exception in thread "main" java.lang.UnsupportedClassVersionError: ch/qos/logback/classic/spi/LogbackServiceProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
        at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
        at java.util.ServiceLoader$1.next(Unknown Source)
        at org.slf4j.LoggerFactory.safelyInstantiate(LoggerFactory.java:118)
        at org.slf4j.LoggerFactory.findServiceProviders(LoggerFactory.java:111)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:162)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:154)
        at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:437)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:423)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:372)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:398)
        at com.billialpha.discord.transfer.DiscordTransfer.<clinit>(DiscordTransfer.java:52)

Crash when trying to migrate a message with the maximum number of reactions

When the bot is migrating a channel and tries to process a message that already has the maximum number of reactions (20 unique emotes) added to it, it crashes with the following error message:

2023-01-27 12:49:19 WARN  com.billialpha.discord.transfer.DiscordTransfer - Error in channel migration
discord4j.rest.http.client.ClientException: PUT /channels/353359965081305088/messages/356953624934613002/reactions/%F0%9F%94%84/@me returned 403 Forbidden with response {code=30010, message=Maximum number of reactions reached (20)}
        at discord4j.rest.http.client.ClientResponse.clientException(ClientResponse.java:171)
        Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

Example message from my server:
image

I'd probably expect the bot to write a warning message to the log and just skip adding the "processed" reaction to this particular message.

Bot stops working after a large number of messages in a channel. It simply won't work regardless of how many times I tried. The bot also take more time to load the more messages it have transferred.

2023-01-27 23:59:41 INFO com.billialpha.discord.transfer.DiscordTransfer - Logging in ...
2023-01-27 23:59:48 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged in, user: Migrator#6340
2023-01-27 23:59:49 INFO com.billialpha.discord.transfer.DiscordTransfer - Loaded source guild:
2023-01-27 23:59:49 INFO com.billialpha.discord.transfer.DiscordTransfer - Loaded dest guild:
2023-01-27 23:59:49 INFO com.billialpha.discord.transfer.DiscordTransfer - Start action 'migrate'
2023-01-27 23:59:49 INFO com.billialpha.discord.transfer.DiscordTransfer - Starting migration ...
2023-01-27 23:59:49 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating category:
2023-01-27 23:59:49 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel:
2023-01-28 00:17:39 WARN com.billialpha.discord.transfer.DiscordTransfer - Error in channel migration
java.net.UnknownHostException: Failed to resolve 'discord.com' after 4 queries
at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1047)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ? Request to GET /channels/834237787053490187/messages [RequestStream]
*__checkpoint ? Request to GET /channels/834237787053490187/messages [DefaultRouter]
Original Stack Trace:
at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1047)
at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:1000)
at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:418)
at io.netty.resolver.dns.DnsResolveContext.access$600(DnsResolveContext.java:66)
at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:467)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491)
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616)
at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
at io.netty.resolver.dns.DnsQueryContext.tryFailure(DnsQueryContext.java:256)
at io.netty.resolver.dns.DnsQueryContext$4.run(DnsQueryContext.java:208)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: io.netty.resolver.dns.DnsNameResolverTimeoutException: [/127.0.2.3:53] query via UDP timed out after 5000 milliseconds (no stack trace available)
2023-01-28 00:17:39 INFO com.billialpha.discord.transfer.DiscordTransfer - Migration finished successfully (null messages)
2023-01-28 00:17:39 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged out

How do you add the DISCORD_TOKEN?

Hi there. I've got everything set, but cannot figure out how to feed the bot token as an environmental variable for the app. Is this done via the command line? Every time I've tried it returns: Missing arguments (action, guildA, guildB)

"Copy the bot token and pass it to the application via the DISCORD_TOKEN environment variable"
I have the token, how do I get it into the app?

Do I create a file? Or run a command like: java -jar discord-transfer.jar DISCORD_TOKEN ansdfnasdnANSFNASDfASDNF

Thank you

Adapt arguments to action

As presented in #14 the clean action still takes 2 arguments (src and dest) even though it only uses the first. We could get rid of the second one for this action.

Guild ID too long

I tried hardcoding the values, but I'm observing an error that the integer values are too long... am I missing something?

413 Payload Too Large with response {code=40005, message=Request entity too large}

@BilliAlpha
Thank you for this great bot, but I seem to have a problem with it that probably doesn't deserve this but I don't know what else can I try to do. Bot seems to get stuck with 413 error every time I try to migrate and after failing to find a solution to the problem online I'm only left with asking you. Sorry in advance for this sounding very rude but English is not my first language so I don't know how to make this sound polite.
This is what it tells me:
2021-12-05 06:47:48 INFO com.billialpha.discord.transfer.DiscordTransfer - Logging in ...
2021-12-05 06:47:50 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged in, user: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Loaded source guild: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Loaded dest guild: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Start action 'migrate'
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Starting migration ...
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating category: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:47:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Migrating channel: *****
2021-12-05 06:49:55 WARN com.billialpha.discord.transfer.DiscordTransfer - Error in channel migration
discord4j.rest.http.client.ClientException: POST /channels/896317808911192090/messages returned 413 Payload Too Large with response {code=40005, message=Request entity too large}
lots of messages...
2021-12-05 06:49:55 INFO com.billialpha.discord.transfer.DiscordTransfer - Migration finished successfully (0 messages)
2021-12-05 06:49:55 INFO com.billialpha.discord.transfer.DiscordTransfer - Logged out
Thank you very much in advance!

Message content not copied

Hi. Thanks for this tool! I tried to migrate one channel, and the tool succesfully retirieved all message from it. Unfortunetly, He only get the date and author :
image

Did I miss something ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.