mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: permissions and magicImport (#285)
* fix: magicImport * fix: dapi-types * fix: socram
This commit is contained in:
parent
4052cb2a53
commit
e7b8806973
@ -279,11 +279,12 @@ export const ReplaceRegex = {
|
||||
};
|
||||
|
||||
export async function magicImport(path: string) {
|
||||
try {
|
||||
return require(path);
|
||||
} catch {
|
||||
return eval('((path) => import(`file:///${path}?update=${Date.now()}`))')(path.split('\\').join('\\\\'));
|
||||
}
|
||||
//@ts-expect-error
|
||||
if (typeof require === 'undefined' || globalThis.Deno)
|
||||
return new Function('return ((path) => import(`file:///${path}?update=${Date.now()}`))')()(
|
||||
path.split('\\').join('\\\\'),
|
||||
);
|
||||
return require(path);
|
||||
}
|
||||
|
||||
export type OnFailCallback = (error: unknown) => any;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { ApplicationIntegrationType, InteractionContextType } from '..';
|
||||
import type { ChannelType, Snowflake } from '../..';
|
||||
import type { ChannelType, Permissions, Snowflake } from '../..';
|
||||
|
||||
import type { LocaleString } from '../../rest';
|
||||
import type {
|
||||
|
@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import type { LocalizationMap } from '.';
|
||||
import type { Snowflake } from '..';
|
||||
import type { Permissions, Snowflake } from '..';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { ApplicationIntegrationType } from './interactions';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Snowflake } from '..';
|
||||
import type { Permissions, Snowflake } from '..';
|
||||
import type {
|
||||
APIBan,
|
||||
APIChannel,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Snowflake } from '..';
|
||||
import type { Permissions, Snowflake } from '..';
|
||||
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads';
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Snowflake } from '..';
|
||||
import type { Permissions, Snowflake } from '..';
|
||||
import type {
|
||||
APIApplicationRoleConnection,
|
||||
APIChannel,
|
||||
|
Loading…
x
Reference in New Issue
Block a user