xernerx 4.8.3 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ export default class XernerxClient extends Client {
8
8
  readonly settings: {
9
9
  ownerId: (string | string[]) & (string | string[] | undefined);
10
10
  local: string;
11
+ ceaseless: boolean;
11
12
  global?: boolean | undefined;
12
13
  permissions?: {
13
14
  user: string[] | null;
@@ -18,6 +18,7 @@ export default class XernerxClient extends Client {
18
18
  local: z.string(),
19
19
  global: z.boolean().default(false).optional(),
20
20
  ownerId: z.string().or(z.array(z.string())).default([]),
21
+ ceaseless: z.boolean().default(false),
21
22
  permissions: z
22
23
  .object({
23
24
  client: z.array(z.string()).or(z.null()).default(null),
@@ -88,6 +89,11 @@ export default class XernerxClient extends Client {
88
89
  async connect(token) {
89
90
  const login = this.login(token);
90
91
  deploy(this);
92
+ if (this.settings.ceaseless) {
93
+ process.on('unhandledRejection', (error) => {
94
+ new XernerxLog(this).error('An uncaught error happpened, this is triggered from the ceaseless setting.', error);
95
+ });
96
+ }
91
97
  new XernerxLog(this).ready();
92
98
  return login;
93
99
  }
@@ -14,6 +14,7 @@ export interface XernerxOptions {
14
14
  local: string;
15
15
  global?: boolean;
16
16
  ownerId?: string | Array<string>;
17
+ ceaseless?: boolean;
17
18
  permissions?: {
18
19
  user?: Array<PermissionNames> | Array<string> | null;
19
20
  client?: Array<PermissionNames> | Array<string> | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "4.8.3",
3
+ "version": "4.9.0",
4
4
  "description": "A bot framework for discord.js.",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",