mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
First command
This commit is contained in:
parent
cbfbf05e8c
commit
a37d5e7613
20
src/commands/stdin/eval.js
Normal file
20
src/commands/stdin/eval.js
Normal file
@ -0,0 +1,20 @@
|
||||
const { StdinCommand } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class extends StdinCommand {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
id: 'stdinEval',
|
||||
name: 'eval',
|
||||
});
|
||||
}
|
||||
|
||||
async run(input) {
|
||||
const toEval = input.join(' ');
|
||||
try {
|
||||
const res = await eval(toEval);
|
||||
console.log(res);
|
||||
} catch (error) {
|
||||
this.client.log.error(error);
|
||||
}
|
||||
}
|
||||
};
|
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
|
||||
const pkg = require('../package.json');
|
||||
const fs = require('fs');
|
||||
const semver = require('semver');
|
||||
const { colours } = require('leeks.js');
|
||||
@ -33,8 +34,6 @@ const Client = require('./client');
|
||||
process.env.NODE_ENV ??= 'development'; // make sure NODE_ENV is set
|
||||
require('dotenv').config(); // load env file
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
||||
|
||||
// check node version
|
||||
if (!semver.satisfies(process.versions.node, pkg.engines.node)) {
|
||||
console.log('\x07' + colours.redBright(`Error: Your current Node.js version, ${process.versions.node}, does not meet the requirement "${pkg.engines.node}".`));
|
||||
|
@ -1,6 +1,6 @@
|
||||
const dbf = require('@eartharoid/dbf');
|
||||
const { Listener } = require('@eartharoid/dbf');
|
||||
|
||||
module.exports = class extends dbf.Listener {
|
||||
module.exports = class extends Listener {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
emitter: client,
|
||||
|
Loading…
Reference in New Issue
Block a user