fhodun / testshoter Goto Github PK
View Code? Open in Web Editor NEWDiscord bot that send content of questions on testportal
Home Page: https://testportal.pl
License: GNU General Public License v3.0
Discord bot that send content of questions on testportal
Home Page: https://testportal.pl
License: GNU General Public License v3.0
Add a notification in the console that bot has started.
Add sending information about name of the test, number of questions and time allocated to test / question
I installed bot on my vps (Ubuntu 16.04). I started bot, it appears online, I try to interact with it by typing >version
. There is no response from bot on discord chat, but in putty I see an error:
npm start
> [email protected] start /root/testshoter
> ts-node -r dotenv/config -r tsconfig-paths/register .
Logged in!
(node:473) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
at Function.normalizeFields (/root/testshoter/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
at MessageEmbed.setup (/root/testshoter/node_modules/discord.js/src/structures/MessageEmbed.js:78:91)
at new MessageEmbed (/root/testshoter/node_modules/discord.js/src/structures/MessageEmbed.js:18:10)
at embedLikes.map.e (/root/testshoter/node_modules/discord.js/src/structures/APIMessage.js:166:40)
at Array.map (<anonymous>)
at APIMessage.resolveData (/root/testshoter/node_modules/discord.js/src/structures/APIMessage.js:166:31)
at TextChannel.send (/root/testshoter/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:166:62)
at /root/testshoter/src/discord/misc.ts:12:25
at Generator.next (<anonymous>)
at /root/testshoter/src/discord/misc.ts:8:71
(node:473) 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: 2)
(node:473) [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.
I did something wrong or what? Need fast help.
pzdr
Move to discord.ts, they add nice features like decorators, and have much better examples than discord.js has
Convert the command system to a better - dynamic command handling from the discord.js documentation
Create instructions for installing and starting bot
Add puppeteer browser session closing or one browser session for multiple tests.
Hello.
I want to host this bot on repl. it but there is problem. I don't know how to npm start
this bot from index.ts file.
Can you describe how to run bot without using console but just index.ts/index.js or whatever file so it run after clicking start
I don't know what I am doing wrong. You can test it on repl.it
When i try to run this from shell npm start
this is output:
> [email protected] start /home/runner/ConsiderableVerticalClosedsource
> ts-node -r dotenv/config -r tsconfig-paths/register .
/home/runner/ConsiderableVerticalClosedsource/src/discord/commands/index.ts:9
throw new Error(
^
Error: COMMAND_PREFIX is not defined in .env, default value is '>'
at Object.<anonymous> (/home/runner/ConsiderableVerticalClosedsource/src/discord/commands/index.ts:9:9)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/home/runner/ConsiderableVerticalClosedsource/node_modules/ts-node/src/index.ts:1056:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/runner/ConsiderableVerticalClosedsource/node_modules/ts-node/src/index.ts:1059:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ts-node -r dotenv/config -r tsconfig-paths/register .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I propose to attach a photo with the test questions to be embedded with the message
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.