Compare commits

...

6 commits
v2.0.1 ... main

Author SHA1 Message Date
Ethan Lane 523ec0a343 v2.0.3 2021-12-02 15:32:29 +00:00
Ethan Lane 6bc0cf3d6a
Update tests to match event changes 2021-12-02 15:32:09 +00:00
Vylpes 7861829f5d
Merge pull request #68 from Vylpes/bug/67-type-error
Fix issue where event files existing would crash the bot
2021-12-02 15:30:08 +00:00
Ethan Lane c526423607
Fix issue where event files existing would crash the bot 2021-12-02 15:28:36 +00:00
Ethan Lane 6d030737fc
Bump version 2021-11-25 18:33:16 +00:00
Ethan Lane acde8b0ccf
Add typings 2021-11-25 18:32:58 +00:00
3 changed files with 9 additions and 8 deletions

View file

@ -1,13 +1,14 @@
{ {
"name": "vylbot-core", "name": "vylbot-core",
"version": "2.0.1", "version": "2.0.3",
"description": "A discord client based upon discord.js", "description": "A discord client based upon discord.js",
"main": "./src/index", "main": "./dist/index",
"typings": "./dist",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"test": "jest", "test": "jest",
"test:coverage": "jest --coverage", "lint": "eslint .",
"lint": "eslint ." "publish": "np"
}, },
"author": "Vylpes", "author": "Vylpes",
"license": "MIT", "license": "MIT",

View file

@ -97,9 +97,9 @@ export class Util {
if (eventFiles[i].includes('.ts')) { if (eventFiles[i].includes('.ts')) {
const eventName = eventFiles[i].split('.')[0]; const eventName = eventFiles[i].split('.')[0];
const file = require(`${process.cwd()}/${folder}/${eventName}.ts`); const file = require(`${process.cwd()}/${folder}/${eventName}.ts`).default;
const event = new file[eventName]() as Event; const event = new file() as Event;
// Load events // Load events
client.on('channelCreate', event.channelCreate); client.on('channelCreate', event.channelCreate);

View file

@ -1,5 +1,5 @@
import { Event } from "../../../src/type/event"; import { Event } from "../../../src/type/event";
export class normal extends Event { export default class normal extends Event {
public override channelCreate() {} public override channelCreate() {}
} }