mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 09:01:38 +01:00
first commit, basic command handling and auth managing
This commit is contained in:
27
bot/events/index.ts
Normal file
27
bot/events/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { eventSub } from "..";
|
||||
|
||||
eventSub.onSubscriptionCreateSuccess(event => {
|
||||
console.info(`Successfully created EventSub subscription: ${event.id}`);
|
||||
});
|
||||
|
||||
eventSub.onSubscriptionCreateFailure(event => {
|
||||
eventSub.stop()
|
||||
console.error(`Failed to create EventSub subscription: ${event.id}`);
|
||||
eventSub.start()
|
||||
});
|
||||
|
||||
eventSub.onSubscriptionDeleteSuccess(event => {
|
||||
console.info(`Successfully deleted EventSub subscription: ${event.id}`);
|
||||
});
|
||||
|
||||
eventSub.onSubscriptionDeleteFailure(event => {
|
||||
console.error(`Failed to delete EventSub subscription: ${event.id}`);
|
||||
});
|
||||
|
||||
import { readdir } from 'node:fs/promises';
|
||||
const files = await readdir(import.meta.dir);
|
||||
for (const file of files) {
|
||||
if (!file.endsWith('.ts')) continue;
|
||||
if (file === import.meta.file) continue;
|
||||
await import(import.meta.dir + '/' + file.slice(0, -3));
|
||||
};
|
||||
Reference in New Issue
Block a user