yugoccp / slack2discord

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

Import Issue #16

Closed OliPassey closed 2 years ago

OliPassey commented 2 years ago

Hey - thanks for the app - i've got things setup and talking to discord but on first run it throws this error in the debug log.

[INFO] Sending from advanced-sarcasm to advanced-sarcasm channel... [INFO] [INFO] Get or create advanced-sarcasm channel... [INFO] [INFO] Get or create advanced-sarcasm/slack2discord Webhook... [INFO] [ERR] TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined [ERR]

It then quits. I can see that my bot permissions have not saved, i believe this is because i have no specified anything OAuth2 or added a redirect URI?

Any advice on getting this running? I guess some things may have changed on the discord side, or im doing something wrong.

yugoccp commented 2 years ago

Hi @OliPassey ! Thanks for reporting! I'll check for API changes and reply you back :)

yugoccp commented 2 years ago

@OliPassey unfortunatelly couldn't reproduce your issue... Since the error raises right after creating the webhook, would double check the bot permissions to access your Server (see README.md) Also have pushed new version with some new fixes and extra logs.

OliPassey commented 2 years ago

Thanks for taking a look, will update and see where i get to.

OliPassey commented 2 years ago

Sadly the new version stops almost immeadiately.

Parsing messages from d:\inadvisable Sending messages from d:\inadvisable/.s2d/out to Discord undefined:1 [INFO] Read Slack advanced-sarcasm channel backup files... ^

SyntaxError: Unexpected token I in JSON at position 1 at JSON.parse () at Object.getMessages (C:\Users\oli.PTSLONDON\AppData\Roaming\npm\node_modules\slack2discord\src\slackService.js:61:15) at async C:\Users\oli.PTSLONDON\AppData\Roaming\npm\node_modules\slack2discord\src\commands\parseMessages.js:27:29

I'm running on windows with latest nodejs - should i be trying this on linux? Sorry for such basic questions.

yugoccp commented 2 years ago

Hi @OliPassey! Good point, I test only on my Mac, let em check if it works well on Windows also, will return you soon! Might also be some error in the message it's trying to parse... will check those lines in the logs.

androidcat commented 2 years ago

I get the same error as @OliPassey when running your script from Windows. Thanks!

yugoccp commented 2 years ago

@OliPassey @androidcat just run here on Windows machine and reproduced the error. Actually not related to the OS, running from the source code it works correctly, the exception is thrown only when I run from the global installed package, have to dig a bit to fix the issue.

If you are in hurry you can clone the repo and run command in the root folder

npm i -g
s2d run -c <YOUR_CONFIG_PATH>
androidcat commented 2 years ago

Thank you very much @yugoccp ! I will try later. Good job!

yugoccp commented 2 years ago

Hi @OliPassey and @androidcat ! Just to let you know, I've updated the code to support Windows properly. hope it works for you :)

androidcat commented 2 years ago

Thanks for your work @yugoccp!