BilliAlpha / discord-transfer

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

Help running the bot + UnsupportedClassVersionError #21

Closed AsrielDreemurr77 closed 1 year ago

AsrielDreemurr77 commented 1 year ago

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)
BilliAlpha commented 1 year ago

Hello, There are two issues here.

First the discord token has to be quoted like $env:DISCORD_TOKEN="this.is.a.fake.token".

Note: Your discord token is private and you should never share it. I recommend you generate a new one since this one has been posted publicly on the internet.

Second, you are using an old version of Java, you can try using Java 11 or up, but this should be working with Java 8. I'll take a look at the last build.

Best of luck!

BilliAlpha commented 1 year ago

PS: You don't need to create channels manually, the bot will do it for you.

AsrielDreemurr77 commented 1 year ago

Thank you, I guess I have to make a new server for the server I wanna transfer the chats too, right?

AsrielDreemurr77 commented 1 year ago

PS: You don't need to create channels manually, the bot will do it for you.

Trying to update Java did not work, it's still giving me the error even though I updated Java It says I'm on the latest version of Java too, Java 8

BilliAlpha commented 1 year ago

Your command seems invalid : java -jar discord-transfer.jar migrate clean 651934270360649737 1126639731145445518 --category 911044132888248331 --skip ... You have to choose one action between migrate and clean. The destination server has to exist yes, it is the second parameter of the migrate action.

AsrielDreemurr77 commented 1 year ago

You command seems invalid : java -jar discord-transfer.jar migrate clean 651934270360649737 1126639731145445518 --category 911044132888248331 --skip ... You have to choose one action between migrate and clean. The destination server has to exist yes, it is the second parameter of the migrate action.

I did this now with the newest version of the bot, I don't know if the channels need to be not private, I also got this problem here:

2023-07-11 16:30:51 INFO com.billialpha.discord.transfer.DiscordTransfer - Starting migration ... ERROR: GET /channels/ returned 403 Forbidden with response {code=50001, message=Missing Access} Run with verbose flag to get stacktrace.

BilliAlpha commented 1 year ago

If the channels are private you have to grant access to the bot user. Otherwise the bot won't be able to read messages as you can see in your error {code=50001, message=Missing Access}

AsrielDreemurr77 commented 1 year ago

I got it to work, but It won't migrate Tupperbox with it, is there a way to do that or can it not do that?

BilliAlpha commented 1 year ago

Can you see a specific error or are the Tupperbox message just skipped ?

AsrielDreemurr77 commented 1 year ago

It just skips every Tupperbox message, could you please do something about it?

I also have Tupperbox in the new server I want to move the channels into

BilliAlpha commented 1 year ago

Can you try with this version ? discord-transfer-modified.zip It won't migrate better but you should see some detailed logs when Tupperbox messages are skipped

AsrielDreemurr77 commented 1 year ago

I'll try to use it, but I do want the Tupper to be migrated

BilliAlpha commented 1 year ago

I know, but as of now I don't really see why those messages would be skipped, so in order for me to understand I need you to try either the version linked above or the last release (v3.0.0) so that we can fetch some more detailed logs

AsrielDreemurr77 commented 1 year ago

whenever I did the 3.0.0 it keeps saying " unknown action 'skip' " and for the modified version it kept saying " unknown action 'Discord_Token' " and just told me to type 'help'

Edit: I got it working again

AsrielDreemurr77 commented 1 year ago

problems:

  1. 3.0.0 kept saying " unknown action 'skip' "
  2. the modified version copied over channels plus some of its messages I don't want (good thing it didn't add it's reactions), will copy channels but not the messages, and will copy the channels and messages I want but didn't do the whole channel filled with messages
  3. Still no Tupper
BilliAlpha commented 1 year ago

Could you paste here the exact command you used ?

AsrielDreemurr77 commented 1 year ago

This is it Luigi: $envDISCORD_TOKEN=MTEyNjY0MDM4ODIzM.txt

BilliAlpha commented 1 year ago

Ok, so the error wasn't unknown action 'skip' but Unknown option: skip which is correct. The option is --skip-channel (or -s in short) not --skip.

Note: You shared your Discord token again, I recommend you change it otherwise everyone on the internet can use your bot and access your servers.

AsrielDreemurr77 commented 1 year ago

Yeah, but it copied over channels I don't want and no tupper again plus not all messages were sent over too Maybe we should chat in dms?

BilliAlpha commented 1 year ago

What is your discord username ?

AsrielDreemurr77 commented 1 year ago

rainbowgal_rb

BilliAlpha commented 1 year ago

Fixed in v3.0.2