lambtron / emojipacks

CLI to bulk upload emojis to your Slack
https://emojipacks.com
MIT License
1.32k stars 199 forks source link

Batch Upload - Permission Denied #164

Open r0ug3 opened 5 years ago

r0ug3 commented 5 years ago

I copied the batchUploadExample.sh file and edited the top fields. Saved as batchUpload.sh and tried running ./batchUpload.sh I am getting a permission error but my shell is running as root.

In addition: Running just one file upload throws an app error after I put in 2FA. Uh oh! Error: Application Error: unable to find api token on login page

elloboblanco commented 5 years ago

Same issue here!

kmcgaire commented 5 years ago

Same!

DavidWatkins commented 5 years ago

I was able to fix it by manually generating a token at: https://api.slack.com/custom-integrations/legacy-tokens and replacing the line opts.apiToken = match[1]; in lib/slack.js with the token itself and commenting out the http request. I am assuming the lack of a generated auth token is the issue?

davem-git commented 5 years ago

fix didn't work for me, assuming i replaced the token properly. Did you put it inside the match[]. or put the token after the =? I've tried multiple different ways no luck

jkogara commented 5 years ago

I tried this approach, https://github.com/lambtron/emojipacks/issues/164#issuecomment-478619697, but the api is returning {"ok":false,"error":"not_allowed_token_type"}

mcconkiee commented 5 years ago

I was able to fix it by manually generating a token at: https://api.slack.com/custom-integrations/legacy-tokens and replacing the line opts.apiToken = match[1]; in lib/slack.js with the token itself and commenting out the http request. I am assuming the lack of a generated auth token is the issue?

Just to clarify what @DavidWatkins did (and does work for me), commenting lines 153-158 (or simply remove) and making it read:

//TODO: it may be necessary in the future to replace this with a user-supplied token
// var match = apiTokenRegex.exec(res[0].body);
// if (!match || !match[1]) {
//   throw new Error('Application Error: unable to find api token on login page');
// }

// opts.apiToken = match[1];  
opts.apiToken = "xxx-your-token-here";
return this.opts = opts;
davem-git commented 5 years ago

So now this doesn't error but it doesn't do anything either

jungledre commented 5 years ago

mcconkiee's tip seemed to work for me but I'm not seeing them in the actual application even after three hours.

I found an alternative solution using chrome extensions.

robhawkins commented 5 years ago

Sometimes the URL filenames do not match the emoji's name. Here is my solution.

In theory someone could make a browser extension that reads a YAML file, downloads the data and then uploads it to slack.

timsully commented 4 years ago

I am having the same issue @davem-git is having. I modified the lib/slack.js file by adding my test API token using the following steps indicated by @mcconkiee but still a recurring issue. Anyone else coming across this issue?

Starting import
Got tokens
Logged in
Uh oh! Error: Login error: could not get emoji upload crumb for https://thyhomiez.slack.com
(node:12726) UnhandledPromiseRejectionWarning: Error: Login error: could not get emoji upload crumb for https://thyhomiez.slack.com
    at Slack.emoji (/Users/tims/.nvm/versions/node/v10.16.0/lib/node_modules/emojipacks/lib/slack.js:162:34)
    at Slack.emoji.next (<anonymous>)
    at onFulfilled (/Users/tims/.nvm/versions/node/v10.16.0/lib/node_modules/emojipacks/node_modules/co/index.js:65:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12726) 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:12726) [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.
packs//fika.yaml