Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/repo readiness #1

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint Check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run Prettier check
run: npx prettier --check .
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"quoteProps": "consistent",
"bracketSpacing": true,
"endOfLine": "auto"
}
}
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Murmur Bots

This is a collection of node.js-based implementations of the murmur protocol. Specifically, this repo contains bot integrations for both [Discord](https://discordapp.com/) and [Twitch](https://www.twitch.tv/), enabling per-channel/server wallets via Murmur.
This is a collection of node.js-based implementations of the [Murmur protocol](https://github.com/ideal-lab5/murmur). Specifically, this repo contains bot integrations for both [Discord](https://discordapp.com/) and [Twitch](https://www.twitch.tv/), enabling per-channel/server wallets via Murmur.

To learn more about the Murmur protocol, visit the documentation at https://murmur.idealabs.network.

Expand All @@ -10,23 +10,24 @@ To learn more about the Murmur protocol, visit the documentation at https://murm

#### Setup

First create a file called .env.discord in the root of this repo containing the following keys:
First create a file called `.env.discord` in the root of this repo containing the following keys:

```
```
MAX_RETRIES=number of times to retry failed transactions
SECRET_SALT=any string
DISCORD_BOT_TOKEN=a valid discord bot token for the server
```

Once configured, install dependencies and run the bot with
``` shell
Once configured, install dependencies and run the Discord bot with

```shell
npm i
npm run discord
```

### Twitch

Create a file called .env.twitch in the root of this repo containing the following keys:
Create a file called `.env.twitch` in the root of this repo containing the following keys:

```
MAX_RETRIES=
Expand All @@ -36,9 +37,21 @@ TWITCH_OAUTH_TOKEN=<twitch chat oauth token>
TWITCH_CHANNEL=<twitch channel name (e.g. your username)>
```

Then instsall depenencies and run the twitch bot with
Then instsall depenencies and run the Twitch bot with

``` shell
```shell
npm i
npm run twitch
```
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request.

## License

This project is licensed under the Apache-2.0. See the [LICENSE](LICENSE) file for details.

## Contact

For any inquiries, please contact [Ideal Labs](https://idealabs.network).
12 changes: 5 additions & 7 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"watch": [
"src"
],
"ext": ".js",
"ignore": [],
"exec": "node dist/server.js"
}
"watch": ["src"],
"ext": ".js",
"ignore": [],
"exec": "node dist/server.js"
}
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"version": "1.0.0",
"description": "Utilities for using Murmur in nodejs",
"main": "index.js",
"repository": "https://github.com/ideal-lab5/murmur-bots",
"scripts": {
"discord": "node src/discord.js",
"twitch": "node src/twitch.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky install"
},
"author": "",
"license": "ISC",
"author": "Ideal Labs <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"@ideallabs/murmur.js": "^0.1.0",
"@polkadot/api": "^14.0.1",
Expand All @@ -26,7 +28,8 @@
"@tsconfig/node20": "^20.1.4",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.1.0"
"prettier-plugin-organize-imports": "^4.1.0",
"husky": "^8.0.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,md}": [
Expand Down
Loading
Loading