Giter VIP home page Giter VIP logo

Comments (26)

CydiaHiko avatar CydiaHiko commented on June 20, 2024 1

wait tried again, and it started

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024 1

Thank you very much for your support so far.
Thank you.

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

Hi @CydiaHiko ,

I'm really sorry to hear that, did you setup the config.json file as per the readme?

The line the error is thrown on according to your error log is

const { ACCESSKEY } = require('../config.json'); which makes me think it could potentially be an issue with your config.json file, please let me know if I'm wrong.

Whatever the issue in your JSON is, it's possibly at the 321st position according to the error log.

Looking forward to hearing from you :) - J

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

Thank you for your reply.

I think I did as described, but if there are any mistakes, please let me know.

{
"BOT_TOKEN": "8q",
"ROLEID": "630689062155714560",
"CHANNELID": "6
8",
"ACCESSKEY": "A4",
"SECRETKEY": "4
m",
"SESSIONTOKEN": "Insert the AWS session token here (may not be needed)",
"INSTANCE": "i-**************"
"MESSAGELOGGING": "F" (or leave as 'T' if you want specific error messages logged to the Discord channel which may contain sensitive info like keys or instance IDs)
}

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

hide secret keys.

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

Hi @CydiaHiko if you remove

"(or leave as 'T' if you want specific error messages logged to the Discord channel which may contain sensitive info like keys or instance IDs)"

It should hopefully work for you, that bit is just a comment explaining what the flag is for.

Hope this helps :)

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

So like this?
{
"BOT_TOKEN": "8-----------------q",
"ROLEID": "6-------------0",
"CHANNELID": "630690371596320788",
"ACCESSKEY": "A----------------------4",
"SECRETKEY": "4-------------------m",
"SESSIONTOKEN": "",
"INSTANCE": "i-0-------------------9"
"MESSAGELOGGING": ""
}

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

Very close, more like:

{
"BOT_TOKEN": "8-----------------q",
"ROLEID": "6-------------0",
"CHANNELID": "630690371596320788",
"ACCESSKEY": "A----------------------4",
"SECRETKEY": "4-------------------m",
"SESSIONTOKEN": "",
"INSTANCE": "i-0-------------------9"
"MESSAGELOGGING": "F"
}

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

still not working...

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

No worries, are you getting a different error log?

if so, what error log are you getting? :)

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

maybe this one

yntaxError: /root/DiscordBot/config.json: Unexpected string in JSON at position 259
at JSON.parse ()
at Object.Module._extensions..json (internal/modules/cjs/loader.js:961:27)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object. (/root/DiscordBot/src/Bot.js:5:23)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

Really sorry to hear this, if you can attach your config.json @CydiaHiko with the keys and sensitive information redacted and I'll give it a test to see if I can find any issues.

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

Does this program work with Linux?
Should I send the secret key without concealing it?

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

Does this program work with Linux?
Should I send the secret key without concealing it?

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

The program definitely should work with Linux, and please do conceal all of your secret keys, but try to maintain the structure of the JSON as that will really help me figure out why it isn't working.

Thank you - J

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

{
"BOT_TOKEN": "--------------------",
"ROLEID": "--------------------",
"CHANNELID": "--------------------",
"ACCESSKEY": "--------------------",
"SECRETKEY": "--------------------",
"SESSIONTOKEN": "Insert the AWS session token here (may not be needed)",
"INSTANCE": "--------------------"
"MESSAGELOGGING": "T" (or leave as 'T' if you want specific error messages logged to the Discord channel which may contain sensitive info like keys or instance IDs)
}

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

hey, you need to remove the comment after the "T" on MESSAGELOGGING, you should remove:

(or leave as 'T' if you want specific error messages logged to the Discord channel which may contain sensitive info like keys or instance IDs)

So your Config should look like this:

{
"BOT_TOKEN": "--------------------",
"ROLEID": "--------------------",
"CHANNELID": "--------------------",
"ACCESSKEY": "--------------------",
"SECRETKEY": "--------------------",
"SESSIONTOKEN": "Insert the AWS session token here (may not be needed)",
"INSTANCE": "--------------------"
"MESSAGELOGGING": "T"
}

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

There is still an error.

yntaxError: /root/DiscordBot/config.json: Unexpected string in JSON at position 321
at JSON.parse ()
at Object.Module._extensions..json (internal/modules/cjs/loader.js:961:27)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object. (/root/DiscordBot/src/Bot.js:5:23)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

{
"BOT_TOKEN":"",
"ROLEID":"",
"CHANNELID":"",
"ACCESSKEY":"",
"SECRETKEY":"",
"SESSIONTOKEN":"",
"INSTANCE":"",
"MESSAGELOGGING":"F"
}

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

If I input this sentence without editing it, will it work?

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

it will work once you insert the relevant keys into their respective places. I tested it on my machine just now and it works as it has been working to date. I will definitely have a closer look once I get back home as to why your file isn't working as I was able to recreate your issue with your file

I've removed the explanations around the file to make copying and pasting easier for you

from aws-discord-bot.

CydiaHiko avatar CydiaHiko commented on June 20, 2024

How can I stop this bot?

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

you can use the ctrl + z / ctrl + c command to stop the running process or alternatively close the terminal window

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

Glad to hear it's starting! Hoping it's running okay for you :)

Just a note @CydiaHiko I would delete your most recent error log as it contains a potentially sensitive key

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

Closing this issue as it appears to be resolved.

Not an issue with code but I could probably clear up my wording and comments in the example config.json, so I'll do that sometime soon.

from aws-discord-bot.

JamesMatchett avatar JamesMatchett commented on June 20, 2024

{
"BOT_TOKEN": "--------------------",
"ROLEID": "--------------------",
"CHANNELID": "--------------------",
"ACCESSKEY": "--------------------",
"SECRETKEY": "--------------------",
"SESSIONTOKEN": "Insert the AWS session token here (may not be needed)",
"INSTANCE": "--------------------"
"MESSAGELOGGING": "T" (or leave as 'T' if you want specific error messages logged to the Discord channel which may contain sensitive info like keys or instance IDs)
}

Hey, just to finish up this issue I couldn't help but not look at it again,

image

After piping your config.json through hexdump and my config.json found that you were simply missing a comma at the end of the line for "Instance", very small difference but it caused the issue!

from aws-discord-bot.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.