seyfert 3.2.0 → 3.2.1-dev-15624887796.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 socram03
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2024 socram03
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,60 +1,60 @@
1
- <div align='center'>
2
- <img src="./assets/icon.png" alt="seyfert" width="200px" />
3
-
4
- **Seyfert is a brand-new Discord framework to take the bot development to a next level**
5
-
6
- [![License](https://img.shields.io/npm/l/seyfert?style=flat-square&logo=apache&color=white)](https://github.com/tiramisulabs/seyfert/blob/main/LICENSE)
7
- [![Version](https://img.shields.io/npm/v/seyfert?color=%23ff0000&logo=npm&style=flat-square)](https://www.npmjs.com/package/seyfert)
8
- [![Discord](https://img.shields.io/discord/1003825077969764412?color=%23406da2&label=support&logo=discord&style=flat-square)](https://discord.com/invite/XNw2RZFzaP)
9
-
10
- </div>
11
-
12
- ## FAQ
13
- ### So, what is `seyfert`?
14
- Seyfert is the ultimate Discord framework! We make it easy to interact with the Discord API, big cache control, scalable code and a pretty dev experience.
15
-
16
- ### Why should I use it?
17
- There are many reasons to use Seyfert, but they dont all fit in this tiny readme, so here is a list of the most awesome reasons!
18
-
19
- - **Low RAM Usage**
20
- - **Latest features**
21
- - **Dev experience**
22
- - **24/6 support (Sunday is for church)**
23
- - **Written from Scratch**
24
- - **Type-safe**
25
- - **And many more!!**
26
-
27
-
28
- ## Installation
29
- > [!NOTE]
30
- > Node v18>= is required (or v16 with `--experimental-fetch` flag), Bun/Node LTS recommended.
31
-
32
- ```sh
33
- pnpm add seyfert
34
- ```
35
-
36
- ```sh
37
- deno add npm:seyfert
38
- ```
39
-
40
- ```sh
41
- bun add seyfert
42
- ```
43
-
44
- ```sh
45
- npm i seyfert
46
- ```
47
- > Or other package manager.
48
-
49
- ## Contributing
50
- We are open to contributions, fork the repo and make your changes!
51
-
52
- ## Useful links
53
-
54
- - [GitHub Repository](https://github.com/tiramisulabs/seyfert)
55
- - [Discord server](https://discord.com/invite/XNw2RZFzaP)
56
- - [npm - core](https://www.npmjs.com/package/seyfert)
57
- - [Website](https://seyfert.dev)
58
- - [Documentation](https://docs.seyfert.dev)
59
-
60
- ![Seyfert star history](https://api.star-history.com/svg?repos=tiramisulabs/seyfert&type=Date)
1
+ <div align='center'>
2
+ <img src="./assets/icon.png" alt="seyfert" width="200px" />
3
+
4
+ **Seyfert is a brand-new Discord framework to take the bot development to a next level**
5
+
6
+ [![License](https://img.shields.io/npm/l/seyfert?style=flat-square&logo=apache&color=white)](https://github.com/tiramisulabs/seyfert/blob/main/LICENSE)
7
+ [![Version](https://img.shields.io/npm/v/seyfert?color=%23ff0000&logo=npm&style=flat-square)](https://www.npmjs.com/package/seyfert)
8
+ [![Discord](https://img.shields.io/discord/1003825077969764412?color=%23406da2&label=support&logo=discord&style=flat-square)](https://discord.com/invite/XNw2RZFzaP)
9
+
10
+ </div>
11
+
12
+ ## FAQ
13
+ ### So, what is `seyfert`?
14
+ Seyfert is the ultimate Discord framework! We make it easy to interact with the Discord API, big cache control, scalable code and a pretty dev experience.
15
+
16
+ ### Why should I use it?
17
+ There are many reasons to use Seyfert, but they dont all fit in this tiny readme, so here is a list of the most awesome reasons!
18
+
19
+ - **Low RAM Usage**
20
+ - **Latest features**
21
+ - **Dev experience**
22
+ - **24/6 support (Sunday is for church)**
23
+ - **Written from Scratch**
24
+ - **Type-safe**
25
+ - **And many more!!**
26
+
27
+
28
+ ## Installation
29
+ > [!NOTE]
30
+ > Node v18>= is required (or v16 with `--experimental-fetch` flag), Bun/Node LTS recommended.
31
+
32
+ ```sh
33
+ pnpm add seyfert
34
+ ```
35
+
36
+ ```sh
37
+ deno add npm:seyfert
38
+ ```
39
+
40
+ ```sh
41
+ bun add seyfert
42
+ ```
43
+
44
+ ```sh
45
+ npm i seyfert
46
+ ```
47
+ > Or other package manager.
48
+
49
+ ## Contributing
50
+ We are open to contributions, fork the repo and make your changes!
51
+
52
+ ## Useful links
53
+
54
+ - [GitHub Repository](https://github.com/tiramisulabs/seyfert)
55
+ - [Discord server](https://discord.com/invite/XNw2RZFzaP)
56
+ - [npm - core](https://www.npmjs.com/package/seyfert)
57
+ - [Website](https://seyfert.dev)
58
+ - [Documentation](https://docs.seyfert.dev)
59
+
60
+ ![Seyfert star history](https://api.star-history.com/svg?repos=tiramisulabs/seyfert&type=Date)
@@ -1,5 +1,5 @@
1
1
  import type { ThreadChannelStructure } from '../../client/transformers';
2
- import { type APIThreadMember, type RESTGetAPIChannelThreadMembersQuery, type RESTGetAPIChannelThreadsArchivedQuery, type RESTPatchAPIChannelJSONBody, type RESTPostAPIChannelMessagesThreadsJSONBody, type RESTPostAPIChannelThreadsJSONBody, type RESTPostAPIGuildForumThreadsJSONBody } from '../../types';
2
+ import type { APIThreadMember, RESTGetAPIChannelThreadMembersQuery, RESTGetAPIChannelThreadsArchivedQuery, RESTPatchAPIChannelJSONBody, RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody } from '../../types';
3
3
  import type { MakeRequired, When } from '../types/util';
4
4
  import { BaseShorter } from './base';
5
5
  export declare class ThreadShorter extends BaseShorter {
@@ -21,12 +21,11 @@ export declare class ThreadShorter extends BaseShorter {
21
21
  fetchMember<WithMember extends boolean = false>(threadId: string, memberId: string, with_member: WithMember): Promise<When<WithMember, Required<APIThreadMember>, GetAPIChannelThreadMemberResult>>;
22
22
  addMember(threadId: string, memberId: string): Promise<undefined>;
23
23
  listMembers<T extends RESTGetAPIChannelThreadMembersQuery = RESTGetAPIChannelThreadMembersQuery>(threadId: string, query?: T): Promise<InferWithMemberOnList<T>>;
24
- listArchived(channelId: string, type: 'public' | 'private', query?: RESTGetAPIChannelThreadsArchivedQuery): Promise<{
24
+ listArchivedThreads(channelId: string, type: 'public' | 'private', query?: RESTGetAPIChannelThreadsArchivedQuery): Promise<{
25
25
  threads: ThreadChannelStructure[];
26
26
  members: GetAPIChannelThreadMemberResult[];
27
27
  hasMore: boolean;
28
28
  }>;
29
- listGuildActive(guildId: string, force?: boolean): Promise<ThreadChannelStructure[]>;
30
29
  listJoinedArchivedPrivate(channelId: string, query?: RESTGetAPIChannelThreadsArchivedQuery): Promise<{
31
30
  threads: ThreadChannelStructure[];
32
31
  members: GetAPIChannelThreadMemberResult[];
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ThreadShorter = void 0;
4
4
  const __1 = require("../..");
5
5
  const structures_1 = require("../../structures");
6
- const types_1 = require("../../types");
7
6
  const base_1 = require("./base");
8
7
  class ThreadShorter extends base_1.BaseShorter {
9
8
  /**
@@ -22,11 +21,16 @@ class ThreadShorter extends base_1.BaseShorter {
22
21
  return (0, structures_1.channelFrom)(thread, this.client);
23
22
  }));
24
23
  }
25
- async fromMessage(channelId, messageId, options) {
24
+ fromMessage(channelId, messageId, options) {
26
25
  const { reason, ...body } = options;
27
- const thread = await this.client.proxy.channels(channelId).messages(messageId).threads.post({ body, reason });
28
- await this.client.cache.channels?.setIfNI(__1.CacheFrom.Rest, 'Guilds', thread.id, thread.guild_id, thread);
29
- return await (0, structures_1.channelFrom)(thread, this.client);
26
+ return this.client.proxy
27
+ .channels(channelId)
28
+ .messages(messageId)
29
+ .threads.post({ body, reason })
30
+ .then(async (thread) => {
31
+ await this.client.cache.channels?.setIfNI(__1.CacheFrom.Rest, 'Guilds', thread.id, thread.guild_id, thread);
32
+ return (0, structures_1.channelFrom)(thread, this.client);
33
+ });
30
34
  }
31
35
  join(threadId) {
32
36
  return this.client.proxy.channels(threadId)['thread-members']('@me').put();
@@ -34,9 +38,8 @@ class ThreadShorter extends base_1.BaseShorter {
34
38
  leave(threadId) {
35
39
  return this.client.proxy.channels(threadId)['thread-members']('@me').delete();
36
40
  }
37
- async lock(threadId, locked = true, reason) {
38
- const x = await this.edit(threadId, { locked }, reason);
39
- return (0, structures_1.channelFrom)(x, this.client);
41
+ lock(threadId, locked = true, reason) {
42
+ return this.edit(threadId, { locked }, reason).then(x => (0, structures_1.channelFrom)(x, this.client));
40
43
  }
41
44
  async edit(threadId, body, reason) {
42
45
  return (await this.client.channels.edit(threadId, body, { reason }));
@@ -57,7 +60,7 @@ class ThreadShorter extends base_1.BaseShorter {
57
60
  listMembers(threadId, query) {
58
61
  return this.client.proxy.channels(threadId)['thread-members'].get({ query });
59
62
  }
60
- async listArchived(channelId, type, query) {
63
+ async listArchivedThreads(channelId, type, query) {
61
64
  const data = await this.client.proxy.channels(channelId).threads.archived[type].get({ query });
62
65
  return {
63
66
  threads: data.threads.map(thread => (0, structures_1.channelFrom)(thread, this.client)),
@@ -65,20 +68,6 @@ class ThreadShorter extends base_1.BaseShorter {
65
68
  hasMore: data.has_more,
66
69
  };
67
70
  }
68
- async listGuildActive(guildId, force = false) {
69
- if (!force) {
70
- const cached = await this.client.cache.channels?.valuesRaw(guildId);
71
- if (cached)
72
- return cached
73
- .filter(x => [types_1.ChannelType.PublicThread, types_1.ChannelType.PrivateThread, types_1.ChannelType.AnnouncementThread].includes(x.type))
74
- .map(x => (0, structures_1.channelFrom)(x, this.client));
75
- }
76
- const data = await this.client.proxy.guilds(guildId).threads.active.get();
77
- return Promise.all(data.threads.map(async (thread) => {
78
- await this.client.cache.channels?.setIfNI(__1.CacheFrom.Rest, 'Guilds', thread.id, guildId, thread);
79
- return (0, structures_1.channelFrom)(thread, this.client);
80
- }));
81
- }
82
71
  async listJoinedArchivedPrivate(channelId, query) {
83
72
  const data = await this.client.proxy.channels(channelId).users('@me').threads.archived.private.get({ query });
84
73
  return {
@@ -14,4 +14,4 @@ export type __InternalParseLocale<T extends Record<string, any>> = {
14
14
  } : never;
15
15
  };
16
16
  export type ParseLocales<T extends Record<string, any>> = T;
17
- /**Idea inspiration from: FreeAoi | Fixed by: Drylozu */
17
+ /**Idea inspiration from: FreeAoi */
@@ -13,8 +13,6 @@ const LangRouter = (userLocale, defaultLang, langs) => {
13
13
  if (typeof locale === 'undefined')
14
14
  throw new Error('Undefined locale');
15
15
  let value = langs[locale];
16
- if (typeof value === 'undefined')
17
- throw new Error(`Locale "${locale}" not found`);
18
16
  for (const i of route)
19
17
  value = value[i];
20
18
  return value;
@@ -41,4 +39,4 @@ const LangRouter = (userLocale, defaultLang, langs) => {
41
39
  return createProxy;
42
40
  };
43
41
  exports.LangRouter = LangRouter;
44
- /**Idea inspiration from: FreeAoi | Fixed by: Drylozu */
42
+ /**Idea inspiration from: FreeAoi */
@@ -1,4 +1,4 @@
1
- import type { GuildMemberStructure, GuildStructure, ThreadChannelStructure } from '../client';
1
+ import type { GuildMemberStructure, GuildStructure } from '../client';
2
2
  import type { UsingClient } from '../commands';
3
3
  import type { CreateInviteFromChannel } from '../common';
4
4
  import type { ObjectToLower, StructPropState, StructStates, ToClass } from '../common/types/util';
@@ -20,7 +20,6 @@ export declare class Guild<State extends StructStates = 'api'> extends Guild_bas
20
20
  get maxStickers(): MaxStickers;
21
21
  get maxEmojis(): MaxEmojis;
22
22
  fetchOwner(force?: boolean): Promise<GuildMemberStructure | null>;
23
- listActiveThreads(force?: boolean): Promise<ThreadChannelStructure[]>;
24
23
  templates: {
25
24
  fetch: (code: string) => Promise<import("../client").GuildTemplateStructure>;
26
25
  list: () => Promise<import("../client").GuildTemplateStructure[]>;
@@ -56,9 +56,6 @@ class Guild extends BaseGuild_1.BaseGuild {
56
56
  }
57
57
  return this.members.fetch(this.ownerId, force);
58
58
  }
59
- listActiveThreads(force = false) {
60
- return this.client.threads.listGuildActive(this.id, force);
61
- }
62
59
  templates = GuildTemplate_1.GuildTemplate.methods({ client: this.client, guildId: this.id });
63
60
  stickers = Sticker_1.Sticker.methods({ client: this.client, guildId: this.id });
64
61
  members = GuildMember_1.GuildMember.methods({ client: this.client, guildId: this.id });
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "seyfert",
3
- "version": "3.2.0",
4
- "description": "The most advanced framework for discord bots",
5
- "main": "./lib/index.js",
6
- "module": "./lib/index.js",
7
- "types": "./lib/index.d.ts",
8
- "files": [
9
- "lib/**"
10
- ],
11
- "scripts": {
12
- "build": "tsc --outDir ./lib",
13
- "prepublishOnly": "npm run build",
14
- "prepare": "npm run build && husky",
15
- "lint": "biome lint --write ./src",
16
- "format": "biome format --write ./src",
17
- "check-h": "biome check --write ./src",
18
- "check": "biome check --verbose --write --no-errors-on-unmatched ./src",
19
- "test": "vitest run --config ./tests/vitest.config.mts ./tests/"
20
- },
21
- "author": "MARCROCK22",
22
- "license": "MIT",
23
- "devDependencies": {
24
- "@biomejs/biome": "1.9.4",
25
- "@changesets/cli": "^2.29.4",
26
- "@commitlint/cli": "^19.8.1",
27
- "@commitlint/config-conventional": "^19.8.1",
28
- "@types/node": "^24.0.1",
29
- "husky": "^9.1.7",
30
- "lint-staged": "^15.5.1",
31
- "typescript": "^5.8.3",
32
- "vitest": "^3.2.3"
33
- },
34
- "homepage": "https://seyfert.dev",
35
- "repository": {
36
- "type": "git",
37
- "url": "git+https://github.com/tiramisulabs/seyfert.git"
38
- },
39
- "bugs": {
40
- "url": "https://github.com/tiramisulabs/seyfert"
41
- },
42
- "keywords": [
43
- "api",
44
- "discord",
45
- "bots",
46
- "typescript",
47
- "botdev"
48
- ],
49
- "publishConfig": {
50
- "access": "public"
51
- },
52
- "maintainers": [
53
- {
54
- "name": "socram03",
55
- "url": "https://github.com/socram03"
56
- }
57
- ],
58
- "contributors": [
59
- {
60
- "name": "Free 公園",
61
- "url": "https://github.com/FreeAoi"
62
- },
63
- {
64
- "name": "David",
65
- "url": "https://github.com/Drylozu"
66
- }
67
- ],
68
- "lint-staged": {
69
- "*.ts": [
70
- "biome check --write"
71
- ]
72
- },
73
- "pnpm": {
74
- "onlyBuiltDependencies": [
75
- "@biomejs/biome",
76
- "esbuild"
77
- ]
78
- }
79
- }
1
+ {
2
+ "name": "seyfert",
3
+ "version": "3.2.1-dev-15624887796.0",
4
+ "description": "The most advanced framework for discord bots",
5
+ "main": "./lib/index.js",
6
+ "module": "./lib/index.js",
7
+ "types": "./lib/index.d.ts",
8
+ "files": [
9
+ "lib/**"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc --outDir ./lib",
13
+ "prepublishOnly": "npm run build",
14
+ "prepare": "npm run build && husky",
15
+ "lint": "biome lint --write ./src",
16
+ "format": "biome format --write ./src",
17
+ "check-h": "biome check --write ./src",
18
+ "check": "biome check --verbose --write --no-errors-on-unmatched ./src",
19
+ "test": "vitest run --config ./tests/vitest.config.mts ./tests/"
20
+ },
21
+ "author": "MARCROCK22",
22
+ "license": "MIT",
23
+ "devDependencies": {
24
+ "@biomejs/biome": "1.9.4",
25
+ "@changesets/cli": "^2.29.4",
26
+ "@commitlint/cli": "^19.8.1",
27
+ "@commitlint/config-conventional": "^19.8.1",
28
+ "@types/node": "^24.0.1",
29
+ "husky": "^9.1.7",
30
+ "lint-staged": "^15.5.1",
31
+ "typescript": "^5.8.3",
32
+ "vitest": "^3.2.3"
33
+ },
34
+ "homepage": "https://seyfert.dev",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/tiramisulabs/seyfert.git"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/tiramisulabs/seyfert"
41
+ },
42
+ "keywords": [
43
+ "api",
44
+ "discord",
45
+ "bots",
46
+ "typescript",
47
+ "botdev"
48
+ ],
49
+ "publishConfig": {
50
+ "access": "public"
51
+ },
52
+ "maintainers": [
53
+ {
54
+ "name": "socram03",
55
+ "url": "https://github.com/socram03"
56
+ }
57
+ ],
58
+ "contributors": [
59
+ {
60
+ "name": "Free 公園",
61
+ "url": "https://github.com/FreeAoi"
62
+ },
63
+ {
64
+ "name": "David",
65
+ "url": "https://github.com/Drylozu"
66
+ }
67
+ ],
68
+ "lint-staged": {
69
+ "*.ts": [
70
+ "biome check --write"
71
+ ]
72
+ },
73
+ "pnpm": {
74
+ "onlyBuiltDependencies": [
75
+ "@biomejs/biome",
76
+ "esbuild"
77
+ ]
78
+ }
79
+ }