Comments (26)
wait tried again, and it started
from aws-discord-bot.
Thank you very much for your support so far.
Thank you.
from aws-discord-bot.
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.
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": "68",
"ACCESSKEY": "A4",
"SECRETKEY": "4m",
"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.
hide secret keys.
from aws-discord-bot.
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.
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.
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.
still not working...
from aws-discord-bot.
No worries, are you getting a different error log?
if so, what error log are you getting? :)
from aws-discord-bot.
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.
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.
Does this program work with Linux?
Should I send the secret key without concealing it?
from aws-discord-bot.
Does this program work with Linux?
Should I send the secret key without concealing it?
from aws-discord-bot.
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.
{
"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.
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.
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.
{
"BOT_TOKEN":"",
"ROLEID":"",
"CHANNELID":"",
"ACCESSKEY":"",
"SECRETKEY":"",
"SESSIONTOKEN":"",
"INSTANCE":"",
"MESSAGELOGGING":"F"
}
from aws-discord-bot.
If I input this sentence without editing it, will it work?
from aws-discord-bot.
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.
How can I stop this bot?
from aws-discord-bot.
you can use the ctrl + z / ctrl + c command to stop the running process or alternatively close the terminal window
from aws-discord-bot.
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.
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.
{
"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,
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)
- Move ChannelID and RoleID to ChannelName and RoleName to make setup easier
- Return instance status through AWS CLI call
- Change help docs to include command prefix
- Reformat code and extract repeated code to callable methods HOT 1
- See if top level node packages folder can be removed HOT 1
- Add codebeat integration
- Add command list to readme.md
- Instance name instead of Keypair Name HOT 2
- AWS CLI command forwarding
- Clean up local logs
- change the starting the server in bot.js to Japanese
- $aws status error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-discord-bot.