lolka.js 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +19 -131
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,148 +1,36 @@
1
- <div align="center">
2
- <br />
3
- <p>
4
- <a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
5
- </p>
6
- <br />
7
- <p>
8
- <a href="https://discord.gg/djs"><img src="https://img.shields.io/badge/join_us-on_discord-5865F2?logo=discord&logoColor=white" alt="Discord server" /></a>
9
- <a href="https://www.npmjs.com/package/discord.js"><img src="https://img.shields.io/npm/v/discord.js.svg?maxAge=3600" alt="npm version" /></a>
10
- <a href="https://www.npmjs.com/package/discord.js"><img src="https://img.shields.io/npm/dt/discord.js.svg?maxAge=3600" alt="npm downloads" /></a>
11
- <a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/tests.yml/badge.svg" alt="Tests status" /></a>
12
- <a href="https://github.com/discordjs/discord.js/commits/main/packages/discord.js"><img alt="Last commit." src="https://img.shields.io/github/last-commit/discordjs/discord.js?logo=github&logoColor=ffffff&path=packages%2Fdiscord.js" /></a>
13
- <a href="https://opencollective.com/discordjs"><img src="https://img.shields.io/opencollective/backers/discordjs?maxAge=3600&logo=opencollective" alt="backers" /></a>
14
- <a href="https://codecov.io/gh/discordjs/discord.js"><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2" alt="Code coverage" /></a>
15
- </p>
16
- <p>
17
- <a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-vercel.svg" alt="Vercel" /></a>
18
- <a href="https://www.cloudflare.com"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-workers.png" alt="Cloudflare Workers" height="44" /></a>
19
- </p>
20
- </div>
1
+ # lolka.js
21
2
 
22
- ## About
3
+ **Fork of [discord.js](https://github.com/discordjs/discord.js), licensed under Apache-2.0.**
4
+ Copyright (c) the discord.js contributors.
23
5
 
24
- discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to easily interact with the
25
- [Discord API](https://discord.com/developers/docs/intro).
6
+ `lolka.js` is a Node.js module for interacting with the **lolka** bot API. It targets lolka by
7
+ default (REST/Gateway, no manual overrides needed), decodes lolka snowflakes, and resolves lolka
8
+ CDN asset URLs. See [`NOTICE`](https://github.com/Lolka-App/lolka.js/blob/main/NOTICE) /
9
+ [`LICENSE`](https://github.com/Lolka-App/lolka.js/blob/main/LICENSE) for licensing.
26
10
 
27
- - Object-oriented
28
- - Predictable abstractions
29
- - Performant
30
- - 100% coverage of the Discord API
31
-
32
- ## Installation
33
-
34
- **Node.js 22.12.0 or newer is required.**
11
+ ## Installing
35
12
 
36
13
  ```sh
37
- npm install discord.js
38
- yarn add discord.js
39
- pnpm add discord.js
40
- bun add discord.js
14
+ npm install lolka.js
41
15
  ```
42
16
 
43
- ### Optional packages
44
-
45
- - [zlib-sync](https://www.npmjs.com/package/zlib-sync) for WebSocket data compression and inflation (`npm install zlib-sync`)
46
- - [bufferutil](https://www.npmjs.com/package/bufferutil) for a much faster WebSocket connection (`npm install bufferutil`)
47
- - [@discordjs/voice](https://www.npmjs.com/package/@discordjs/voice) for interacting with the Discord Voice API (`npm install @discordjs/voice`)
48
-
49
- ## Example usage
50
-
51
- Install discord.js:
52
-
53
- ```sh
54
- npm install discord.js
55
- yarn add discord.js
56
- pnpm add discord.js
57
- bun add discord.js
58
- ```
59
-
60
- These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).
61
-
62
- Register a slash command against the Discord API:
63
-
64
- ```js
65
- import { REST, Routes } from 'discord.js';
66
-
67
- const commands = [
68
- {
69
- name: 'ping',
70
- description: 'Replies with Pong!',
71
- },
72
- ];
73
-
74
- const rest = new REST({ version: '10' }).setToken(TOKEN);
75
-
76
- try {
77
- console.log('Started refreshing application (/) commands.');
78
-
79
- await rest.put(Routes.applicationCommands(CLIENT_ID), { body: commands });
80
-
81
- console.log('Successfully reloaded application (/) commands.');
82
- } catch (error) {
83
- console.error(error);
84
- }
85
- ```
17
+ **Node.js 22.12.0 or newer is required.**
86
18
 
87
- Afterwards we can create a quite simple example bot:
19
+ ## Quick Example
88
20
 
89
21
  ```js
90
- import { Client, Events, GatewayIntentBits } from 'discord.js';
22
+ const { Client, GatewayIntentBits } = require('lolka.js');
91
23
 
92
- const client = new Client({ intents: [GatewayIntentBits.Guilds] });
24
+ const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] });
93
25
 
94
- client.on(Events.ClientReady, readyClient => {
95
- console.log(`Logged in as ${readyClient.user.tag}!`);
26
+ client.once('ready', () => {
27
+ console.log(`Logged on as ${client.user.tag}`);
96
28
  });
97
29
 
98
- client.on(Events.InteractionCreate, async interaction => {
99
- if (!interaction.isChatInputCommand()) return;
100
-
101
- if (interaction.commandName === 'ping') {
102
- await interaction.reply('Pong!');
103
- }
30
+ client.on('messageCreate', (message) => {
31
+ if (message.author.bot) return;
32
+ if (message.content === 'ping') message.channel.send('pong');
104
33
  });
105
34
 
106
- client.login(TOKEN);
35
+ client.login('token');
107
36
  ```
108
-
109
- ## Links
110
-
111
- - [Website][website] ([source][website-source])
112
- - [Documentation][documentation]
113
- - [Guide][guide] ([source][guide-source])
114
- Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
115
- - [discord.js Discord server][discord]
116
- - [Discord Developers Discord server][discord-developers]
117
- - [GitHub][source]
118
- - [npm][npm]
119
- - [Related libraries][related-libs]
120
-
121
- ### Extensions
122
-
123
- - [RPC][rpc] ([source][rpc-source])
124
-
125
- ## Contributing
126
-
127
- Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
128
- [documentation][documentation].
129
- See [the contribution guide][contributing] if you'd like to submit a PR.
130
-
131
- ## Help
132
-
133
- If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
134
-
135
- [website]: https://discord.js.org
136
- [website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
137
- [documentation]: https://discord.js.org/docs/packages/discord.js/stable
138
- [guide]: https://discordjs.guide
139
- [guide-source]: https://github.com/discordjs/discord.js/tree/main/apps/guide
140
- [guide-update]: https://discordjs.guide/legacy/additional-info/changes-in-v14
141
- [discord]: https://discord.gg/djs
142
- [discord-developers]: https://discord.gg/discord-developers
143
- [source]: https://github.com/discordjs/discord.js/tree/main/packages/discord.js
144
- [npm]: https://www.npmjs.com/package/discord.js
145
- [related-libs]: https://docs.discord.com/developers/developer-tools/community-resources#libraries
146
- [rpc]: https://www.npmjs.com/package/discord-rpc
147
- [rpc-source]: https://github.com/discordjs/RPC
148
- [contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "lolka.js",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "description": "A powerful library for interacting with the lolka bot API (discord.js-compatible fork)",
6
6
  "scripts": {
7
7
  "test": "pnpm run docs:test && pnpm run test:typescript",