mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
Merge branch 'main' of https://github.com/jacoobes/Sern
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Err, Ok, Result } from 'ts-results';
|
||||
import type { possibleOutput } from '../../../Types/Handler';
|
||||
import type { possibleOutput } from '../../../types/handler';
|
||||
|
||||
/**
|
||||
* Wrapper type taking `Ok(T)` or `Err(possibleOutput)` e.g `Result<T, possibleOutput`
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import dayjs from 'dayjs';
|
||||
import timezone from 'dayjs/plugin/timezone';
|
||||
import utc from 'dayjs/plugin/timezone';
|
||||
|
||||
enum sEvent {
|
||||
TEXT_CMD,
|
||||
GLOBAL_SLASH,
|
||||
@@ -8,6 +12,6 @@ enum sEvent {
|
||||
|
||||
class Logger {
|
||||
public log<T extends sEvent>(e : T, message: string) {
|
||||
console.log(`[${"ISOSTRING (todo) "}][${sEvent[e]}] :: ${message}`);
|
||||
console.log(`[${'ISOSTRING (todo) '}][${sEvent[e]}] :: ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
import * as Files from './Utilities/readFile';
|
||||
import type * as Utils from './Utilities/Preprocessors/args';
|
||||
import * as Files from './utilities/readFile';
|
||||
import type * as Utils from './utilities/preprocessors/args';
|
||||
|
||||
import type {
|
||||
<<<<<<< HEAD
|
||||
Arg,
|
||||
Context,
|
||||
Visibility,
|
||||
possibleOutput
|
||||
} from '../Types/Handler';
|
||||
=======
|
||||
Arg,
|
||||
Context,
|
||||
Visibility,
|
||||
possibleOutput
|
||||
} from '../types/handler';
|
||||
>>>>>>> ad86658e11a26d01e86d1a83e0bbcecef57d3001
|
||||
|
||||
import type {
|
||||
ApplicationCommandOptionData,
|
||||
@@ -17,7 +25,8 @@ import type {
|
||||
} from 'discord.js';
|
||||
|
||||
import { Ok, Result, None, Some } from 'ts-results';
|
||||
import { isBot, hasPrefix, fmt } from './Utilities/messageHelpers';
|
||||
import { isBot, hasPrefix, fmt } from './utilities/messageHelpers';
|
||||
import Logger from './logger';
|
||||
|
||||
|
||||
/**
|
||||
@@ -47,6 +56,7 @@ export class Handler {
|
||||
Files.buildData(this)
|
||||
.then(data => this.registerModules(data))
|
||||
if (wrapper.init !== undefined) wrapper.init(this);
|
||||
new Logger().tableRam();
|
||||
})
|
||||
|
||||
.on('messageCreate', async (message: any) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as Sern from './Handler/sern';
|
||||
import * as Utils from './Handler/Utilities/Preprocessors/args';
|
||||
import * as Types from './Types/Handler';
|
||||
import * as Sern from './handler/sern';
|
||||
import * as Utils from './handler/utilities/preprocessors/args';
|
||||
import * as Types from './types/handler';
|
||||
|
||||
module.exports = { Sern, Utils, Types };
|
||||
export { Sern, Utils, Types };
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
MessageOptions
|
||||
} from 'discord.js';
|
||||
|
||||
import type * as Sern from '../Handler/sern';
|
||||
import type * as Sern from '../handler/sern';
|
||||
|
||||
export type Visibility = 'private' | 'public';
|
||||
|
||||
@@ -28,13 +28,8 @@ export type Context = {
|
||||
message: Option<Message>,
|
||||
interaction: Option<CommandInteraction>
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
export type Arg = ParseType<{ text: string, slash: SlashOptions }>;
|
||||
=======
|
||||
// `string` | `SlashOptions`, narrow down your type by checking `text` | `slash`
|
||||
export type Arg = ParseType<{text : string, slash : SlashOptions}>
|
||||
>>>>>>> 6ce7649311f1d077f6437528cbad10da16e58435
|
||||
|
||||
// TypeAlias for interaction.options
|
||||
export type SlashOptions = Omit<CommandInteractionOptionResolver, 'getMessage' | 'getFocused'>;
|
||||
|
||||
Reference in New Issue
Block a user