BilliAlpha / discord-transfer

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

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

Closed IronPegasus closed 1 year ago

IronPegasus commented 1 year ago

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.

BilliAlpha commented 1 year ago

Hi, you are probably right, the bot currently does not support the latests features of Discord such as threads and forums.

However since this is not the category you are trying to migrate we could ignore this error and just skip this channel. I'll try to publish a fix next by weekend.

IronPegasus commented 1 year ago

I apologize for being a pest, but do you think you'll have a fix for this soon?

BilliAlpha commented 1 year ago

The latest release should probably fix your problem : v2.1.0 Could you give it a try and tell me if it works for you ?

IronPegasus commented 1 year ago

The latest release should probably fix your problem : v2.1.0 Could you give it a try and tell me if it works for you ?

It appears to be working! I was able to kick off a category migration without error. Thank you so, so much for fixing this. You are awesome!

BilliAlpha commented 1 year ago

Glad I could fix your issue.