yugoccp / slack2discord

Slack2DiscordJS - a script to help you transfer Slack messages to Discord
19 stars 3 forks source link

Problem importing Slack to discord #22

Closed stephds01 closed 1 year ago

stephds01 commented 2 years ago

Hello @yougoccp, To start Thank you for your program ;) I encounter an error message when I run the program with this line: s2d run -t "Xttttderfderfderfd" -sid "000000000000000" Here is the error message:

D:\Utilisateurs\Utilisateur\Documents\Transfert Slack\Expatriation Allemagne Slack export Feb 5 2020 - Jul 25 2022> s2d run -t "Xttttderfderfderfd" -sid "000000000000000" Parsing messages from D:\Utilisateurs\Utilisateur\Documents\Transfert Slack\Expatriation Allemagne Slack export Feb 5 2020 - Jul 25 2022 (node:33076) ExperimentalWarning: The fs.promises API is experimental Sending messages from D:\Utilisateurs\Utilisateur\Documents\Transfert Slack\Expatriation Allemagne Slack export Feb 5 2020 - Jul 25 2022/.s2d/out to Discord (node:33076) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token I in JSON at position 1 at JSON.parse () at Object.getMessages (C:\Users\Utilisateur\AppData\Roaming\npm\node_modules\slack2discord\src\slackService.js:61:15) (node:33076) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:33076) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:33076) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channels' of undefined at Object.getOrCreateChannel (C:\Users\Utilisateur\AppData\Roaming\npm\node_modules\slack2discord\src\discordService.js:32:24) at sendToDiscord (C:\Users\Utilisateur\AppData\Roaming\npm\node_modules\slack2discord\src\commands\sendMessages.js:46:42) (node:33076) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

Can you help me ?

Thank's for advance

stephds01 commented 2 years ago

The program works well, the 1st folder has been moved to done but the script does not read json files (See screenshot : https://i.imgur.com/b8Cloct.jpg) capture-29-08-29-004

yugoccp commented 2 years ago

Hi @stephds01 ! Thanks so much to share the error, can you tell me which node version are you using as well?

yugoccp commented 2 years ago

Seems that Discord updated their API, I will update to the latest discordjs client to see if it fixes.

stephds01 commented 2 years ago

Hi @yugoccp, thank's for prompt reply. My version of nodeJS is V10.14.2

yugoccp commented 2 years ago

Hi @stephds01 ! I've pushed new version compatible with latest DiscordJS client. Please take a look on v1.04. IMPORTANT: I could make it work with Node 16+!

stephds01 commented 2 years ago

Hi @yugoccp ! Thank you for your work. I updated my version of node with : v16.17.0. In th json2.pdf json1.pdf e .s2d file I only have the "OUT" file, the "DONE" file was not created. (See capture) In the sub-files of the "out" folder, the Json have been created but they are empty. Do you have a lead?

Thank you in advance for your help

stephds01 commented 2 years ago

Hi @yugoccp !

Sorry to get back to you, but do you have any idea what the problem is? Thank you in advance for your help

yugoccp commented 2 years ago

Hi @stephds01 ! Let me take a look over it! Would be very nice if you can send me a message sample (you can remove any sensitive info you have).

Also, is there any error log during the process?

stephds01 commented 2 years ago

Hi @yugoccp !

Here is the error message capture 1 https://i.imgur.com/ti6JZ90.jpg

Thank's for support

stephds01 commented 2 years ago

Hi @yugoccp !

Sorry to get back to you, but do you have any idea what the problem is? Thank you in advance for your help

yugoccp commented 2 years ago

Hi @stephds01 ! No problem! I'm glad you're trying to use it! :) I believe I can help on this during next week and hope it does work for you. Can you confirm to me which platform you're actually running it? Windows, Linux or Mac?

yugoccp commented 2 years ago

Hi @stephds01 ! I've pushed version 1.0.6 fixing paths to support Windows ans POSIX. Could you please try to run it again?

stephds01 commented 2 years ago

Hi @yugoccp, Thanks for your feedback. I work on Windows, I tried again and unfortunately still an error message in powerShell (See screenshot: https://i.imgur.com/XdonSSF.jpg )

My version of node is v16.17.0

In the folder of my Slack export I have the .s2d folder that was created (See screenshot : https://i.imgur.com/RZ0kw4y.jpg ) Inside I only have the "OUT" folder which was created with its subfolders + the JSONs on the other hand the .json are empty (See screenshot : : https://i.imgur.com/6frJixv.jpg)

However, when I go to the root of the file, the .json files are present and well filled out (See capture: https://i.imgur.com/UkRDgkU.jpg)

Thank's for assistance

stephds01 commented 2 years ago

Hi @yugoccp !

Sorry to get back to you, but do you have any idea what the problem is? Thank you in advance for your help

yugoccp commented 2 years ago

Hi @stephds01 ! One more try here, if you're running the plain command from the slack backup files folder root, can you please try to run it using the config file and outside the backup folder (instructions here: https://github.com/yugoccp/slack2discord#using-configuration-file)?

No need to sorry and thanks for sticking with the package to fix and improve it =)

stephds01 commented 2 years ago

Hi @yugoccp, So I just tried via the configuration file. We advance the OUT folder is filled with .JSON which are not empty. The DONE folder appeared but it is empty. Here are some screenshots:

Folder .s2d > out https://i.imgur.com/UdclQv5.jpg

Folder .s2d > done https://i.imgur.com/hazdWbX.jpg

Terminal error message : https://i.imgur.com/g49O7kJ.jpg

Config.json https://i.imgur.com/VzZdyhq.jpg

Attention, I had an error in line 14 in my .JSON In the documentation you forgot to put "onlyParse "

Thank's you for help

Stéphanie

yugoccp commented 2 years ago

Hi @stephds01 ! From the log message, since couple months there is a new Discord constraint for bot names, which cannot use "discord" on its name. Can you check if its your case? The "onlyParse" option is for message parse step, and won't send the message to Discord Server. If you want to run the whole process you need to turn it off or remove from the config file. I also fixed a bug for embed message, so, recommend to use the version 1.0.8 now =)

Thanks!

stephds01 commented 2 years ago

Salut@yugoccp, My bot is called: USLACKBOT see capture : https://i.imgur.com/8b29cf3.jpg

"" I also fixed a bug for embed message, so, recommend to use the version 1.0.8 now =) ""

This is the version of what? node? My node version is v16.17.0

Thank's

yugoccp commented 2 years ago

@stephds01 is the version of this project :)

yugoccp commented 1 year ago

Closed since there is no update from the issuer :)