@sodiumlabs/gamecord 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 sodiumlabs
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
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ <div align="center">
2
+ <br />
3
+ <h1>Gamecord</h1>
4
+ <br />
5
+ <p>
6
+ <a href="https://discord.gg/8PDXWSHH7k"><img src="https://img.shields.io/discord/1336303640725553213?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
7
+ <a href="https://www.npmjs.com/package/@sodiumlabs/gamecord"><img src="https://img.shields.io/npm/v/@sodiumlabs/gamecord.svg?maxAge=3600" alt="npm version" /></a>
8
+ <a href="https://www.npmjs.com/package/@sodiumlabs/gamecord"><img src="https://img.shields.io/npm/dt/@sodiumlabs/gamecord.svg?maxAge=3600" alt="npm downloads" /></a>
9
+ <a href="https://github.com/sodium-labs/gamecord/commits/main"><img alt="Last commit" src="https://img.shields.io/github/last-commit/sodium-labs/gamecord?logo=github&logoColor=ffffff" /></a>
10
+ </p>
11
+ </div>
12
+
13
+ # About
14
+
15
+ ### Gamecord is a collection of games for your Discord bot.
16
+
17
+ This library was made as a replacement for [discord-gamecord](https://www.npmjs.com/package/discord-gamecord) which is unmaintained (and partially broken) and has no TypeScript support. While the games options are mostly similar, they are more different as they offers more features to customize and handle your games. Also, this module does not contains all games of the original.
18
+
19
+ Each games are documented with examples on the documentation: TODO
20
+
21
+ # Installation
22
+
23
+ ### Node.js 18 or newer is required.
24
+
25
+ ```
26
+ npm install @sodiumlabs/gamecord
27
+ ```
28
+
29
+ # Example usage
30
+
31
+ TODO
32
+
33
+ # Some previews
34
+
35
+ <img src="./.github/images/2048.png" alt="2048 game" width="300">
36
+ <img src="./.github/images/connect4.png" alt="connect4 game" width="300">
37
+ <img src="./.github/images/flood.png" alt="flood game" width="300">
38
+ <img src="./.github/images/memory.png" alt="memory game" width="300">
39
+ <img src="./.github/images/minesweeper.png" alt="minesweeper game" width="300">
40
+ <img src="./.github/images/rockpaperscissors.png" alt="rockpaperscissors game" width="300">
41
+ <img src="./.github/images/tictactoe.png" alt="tictactoe game" width="300">
42
+ <img src="./.github/images/trivia.png" alt="trivia game" width="300">
43
+ <img src="./.github/images/wordle.png" alt="wordle game" width="300">
44
+
45
+ # Notes
46
+
47
+ - The module expects you to pass function that will not error. If it does, the games can break (e.g. by never emitting the `end` or `gameOver` event).
48
+ - If you dont use `.on("error")`, errors will emit `uncaughtException` on your process.
49
+ - Every components custom ids starts with `$gamecord-`.
50
+ - Most games dont need any permissions since it relies on the interaction methods. However if the game is too long (>= 15mins), the interaction became invalid and the bot will need to be able to see the channel and edit its messages.
51
+
52
+ # Links
53
+
54
+ TODO
55
+
56
+ # Help
57
+
58
+ You need help with the module? Ask on our [support server!](https://discord.gg/8PDXWSHH7k)