Skip to content

Commit 5af3621

Browse files
authored
chore: publish to jsr (#30)
* chore: add deno so we can publish to jsr * chore: publish action
1 parent 9fbaaa1 commit 5af3621

27 files changed

+3590
-3067
lines changed

.github/workflows/deno-publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: deno publisher
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Publish package
19+
run: npx jsr publish

README.md

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
<p align="center">
66
<a href="https://www.npmjs.com/package/falgames"><img src="https://img.shields.io/npm/v/falgames.svg?maxAge=3600" alt="npm version" /></a>
77
<a href="https://www.npmjs.com/package/falgames"><img src="https://img.shields.io/npm/dt/falgames.svg?maxAge=3600" alt="npm downloads" /></a>
8-
<a title="Support server" href="https://discord.gg/8WrAtVYVKR">
9-
<img src="https://img.shields.io/discord/742332099788275732.svg?&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&label=Support" alt="Support server">
10-
</a>
11-
<a title="Stars" href="https://github.com/falcao-g/falbot">
12-
<img src="https://img.shields.io/github/stars/falcao-g/Falgames" alt="Stars">
8+
<a href="https://jsr.io/@falcao/falgames"><img src="https://jsr.io/badges/@falcao/falgames" alt="jsr version" /></a>
9+
<a href="https://jsr.io/@falcao/falgames"><img src="https://jsr.io/badges/@falcao/falgames/score" alt="jsr score" /></a>
10+
<a title="Stars" href="https://github.com/falcao-g/falbot">
11+
<img src="https://img.shields.io/github/stars/falcao-g/Falgames" alt="Stars">
1312
</a>
1413
</p>
1514

@@ -28,6 +27,12 @@ Please note that Node v18+ and Discord.js v14+ is required.
2827
npm i falgames
2928
```
3029

30+
or
31+
32+
```bash
33+
deno add @falcao/falgames
34+
```
35+
3136
## 📷 Preview
3237

3338
![Preview](/assets/readme.png)
@@ -37,47 +42,47 @@ npm i falgames
3742
Starting a game with Falgames is as easy as the following example:
3843

3944
```js
40-
const { Snake } = require('falgames');
45+
const { Snake } = require("falgames") // or import { Snake } from "falgames"
4146

4247
const Game = new Snake({
43-
message: message,
44-
isSlashGame: false,
45-
embed: {
46-
title: 'Snake Game',
47-
overTitle: 'Game Over',
48-
scoreText: '**Score:**',
49-
color: '#551476'
50-
},
51-
emojis: {
52-
board: '',
53-
up: '⬆️',
54-
down: '⬇️',
55-
left: '⬅️',
56-
right: '➡️',
57-
},
58-
snake: { head: '🟢', body: '🟩', tail: '🟢', over: '💀' },
59-
foods: ['🍎', '🍇', '🍊', '🫐', '🥕', '🥝', '🌽'],
60-
stopButton: 'Stop',
61-
timeoutTime: 60000,
62-
playerOnlyMessage: 'Only {player} can use these buttons.'
63-
});
64-
65-
Game.startGame();
66-
Game.on('gameOver', result => {
67-
console.log(result); // => { result... }
68-
});
48+
message: message,
49+
isSlashGame: false,
50+
embed: {
51+
title: "Snake Game",
52+
overTitle: "Game Over",
53+
scoreText: "**Score:**",
54+
color: "#551476",
55+
},
56+
emojis: {
57+
board: "",
58+
up: "⬆️",
59+
down: "⬇️",
60+
left: "⬅️",
61+
right: "➡️",
62+
},
63+
snake: { head: "🟢", body: "🟩", tail: "🟢", over: "💀" },
64+
foods: ["🍎", "🍇", "🍊", "🫐", "🥕", "🥝", "🌽"],
65+
stopButton: "Stop",
66+
timeoutTime: 60000,
67+
playerOnlyMessage: "Only {player} can use these buttons.",
68+
})
69+
70+
Game.startGame()
71+
Game.on("gameOver", (result) => {
72+
console.log(result) // => { result... }
73+
})
6974
```
7075

7176
Slash commands are also supported, just set the `isSlashGame` option to `true` and the message option to `interaction`:
7277

7378
```js
74-
const { Snake } = require('falgames');
79+
const { Snake } = require("falgames")
7580

7681
const Game = new Snake({
77-
message: interaction,
78-
isSlashGame: true,
79-
//...
80-
});
82+
message: interaction,
83+
isSlashGame: true,
84+
//...
85+
})
8186
```
8287

8388
Make sure to check out the [examples](examples) folder for more examples.

deno.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@falcao/falgames",
3+
"version": "1.2.2",
4+
"description": "Falgames is a helpful package to enhance your discord bot with fun and interactive minigames",
5+
"main": "index.js",
6+
"exports": "./index.js",
7+
"publish": {
8+
"include": [
9+
"src/",
10+
"index.js",
11+
"utils/"
12+
]
13+
},
14+
"license": "MIT",
15+
"tasks": {
16+
"dev": "deno run --watch test/index.js"
17+
},
18+
"dependencies": {
19+
"canvas": "^3.0.1",
20+
"discord.js": "^14.14.1",
21+
"html-entities": "^2.5.2"
22+
}
23+
}

0 commit comments

Comments
 (0)