Closed shawnshyguy closed 3 years ago
Could you give us an example of your .env? Probably there is a misconfiguration, I've tried to reproduce your issue on Ubuntu Server 20.04.1 LTS but there were no issues.
DISCORD_TOKEN='ODE3NDQwOGDJ4Tk4OTU5NjM2.YEJjIg.ep5J-w7cWAtzHDBFPOI2cn6CQvg' CANVAS_TOKEN='12400~D67ZKLzQJSODKEH3NpyEfoHzH6Nez00f9BfnazB6IDks9jVxniQPxsii13zvsXEM'
CANVAS_API_COURSES_URL='https://**canvas.testschool.com**/api/v1/courses?enrollment_state=active&access_token=**12400~D67ZKLzQJSODKEH3NpyEfoHzH6Nez00f9BfnazB6IDks9jVxniQPxsii13zvsXEM' CANVAS_API_COURSE_URL='https://canvas.testschool.com/api/v1/courses/[courseid]?access_token=12400~D67ZKLzQJSODKEH3NpyEfoHzH6Nez00f9BfnazB6IDks9jVxniQPxsii13zvsXEM' CANVAS_API_ANN_URL='https://canvas.testschool.com/api/v1/announcements?contextcodes[]=course[courseid]&access_token=12400~D67ZKLzQJSODKEH3NpyEfoHzH6Nez00f9BfnazB6IDks9jVxniQPxsii13zvsXEM**'
The bold parameters are the ones that you have to fill in, also the CANVAS_TOKEN value has to be the same as the access token in : CANVAS_API_COURSES_URL, CANVAS_API_COURSE_URL, CANVAS_API_ANN_URL
here's my .env:
fill everything in between <loremipsum>
DISCORD_TOKEN='ODIyMz...'
CANVAS_TOKEN='18471~vyK1F...'
CANVAS_API_COURSES_URL='https://xxxxxpublicschools.instructure.com/api/v1/courses?enrollment_state=active&access_token=18471~vyK1F...'
CANVAS_API_COURSE_URL='https://xxxxxpublicschools.instructure.com/api/v1/courses/[courseid]?access_token=18471~vyK1F...'
CANVAS_API_ANN_URL='https://xxxxxpublicschools.instructure.com/api/v1/announcements?context_codes[]=course_[courseid]&access_token=18471~vyK1F...'
Did you install all your npm modules with npm install
?
Which version of node are you using?
Here is a reference of an issue with the same error --> https://stackoverflow.com/questions/60934727/discord-js-messageembed-fields-flat-is-not-a-function --> https://github.com/discordjs/discord.js/issues/3910
In de docs of discordJS is also described that version 12 of DiscordJS requires Node 12.0 or higher.
Hey, this seemed to fix it! Could've sworn I was running a newer version of node, but I was still on v10. Anyways, thanks for your help, it seems to be all good now.
Hi, Just threw the node bot on my sever real quick, configured
.env
, but.cs
and.wl
commands just throw out errors. namely, for .cs:and .wl:
and after running .ac and it working successfully, .wl now outputs this, and kills the task:
Not sure what's wrong, looking for help. Running Ubuntu Server 20.04.1 LTS.