-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
87 additions
and
295 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: [Adivise] | ||
ko_fi: nanotect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Apache License | ||
Apache License | ||
Version 2.0, January 2004 | ||
http://www.apache.org/licenses/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,60 @@ | ||
## 📑 Short Feature | ||
- [x] Request Song | ||
- [x] Check Current Skin Equip | ||
- [x] See Current Nowplaying | ||
- [x] Check PerfermancePoint When FullCombo | ||
- [x] Easy to use! | ||
<p align="center"> | ||
<img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=200§ion=header&text=SpacePlay&fontSize=80&fontAlignY=35&animation=twinkling&fontColor=gradient"/> </a> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://discord.gg/SNG3dh3MbR" target="_blank"> <img src="https://discordapp.com/api/guilds/903043706410643496/widget.png?style=banner2"/> </a> | ||
</p> | ||
|
||
## 🚨 Have a Problem | ||
<p align="center"> | ||
<a href="https://ko-fi.com/nanotect" target="_blank"> <img src="https://ko-fi.com/img/githubbutton_sm.svg"/> </a> | ||
</p> | ||
|
||
✈ Join Discord: [NanoSpace ♪♪](https://discord.gg/SNG3dh3MbR) | ||
mention me in chat #general or #javascript and ask problem okay! 👌 | ||
## 📑 Feature | ||
- [x] Get Nowplaying | ||
- [x] Lightweight | ||
- [x] Easy to use! | ||
|
||
## 📎 Requirements | ||
|
||
1. Node.js v16+ **[Download](https://nodejs.org/en/download/)** | ||
2. TMI Oauth **[Click Here](https://twitchapps.com/tmi/)** | ||
3. Gosumemory **[Download](https://github.com/l3lackShark/gosumemory)** | ||
4. Osu IRC **[Click Here](https://osu.ppy.sh/p/irc)** | ||
- [x] Node.js **[Download](https://nodejs.org/en/download/)** | ||
- [x] TMI Oauth **[Click Here](https://twitchapps.com/tmi/)** | ||
|
||
## 📚 Installation | ||
|
||
``` | ||
git clone https://github.com/Adivise/Osus | ||
cd Osus | ||
git clone https://github.com/Adivise/SpacePlay | ||
cd SpacePlay | ||
npm install | ||
``` | ||
|
||
After installation finishes you can use `node .` to start the bot. or `Run Start.bat` | ||
After installation finishes you can use `node .` to start the bot. | ||
|
||
## 📄 Configuration | ||
|
||
Copy or Rename `.env.example` to `.env` and fill out the values: | ||
|
||
```.env | ||
# Bot | ||
PREFIX=! | ||
# Twitch https://twitchapps.com/tmi/ | ||
CHANNEL=nanotect_ | ||
USERNAME=adivise | ||
OAUTH=oauth:123456789 | ||
# Osu! https://osu.ppy.sh/p/irc | ||
OSU_NAME=prilz | ||
OSU_PASS=dfasdfadf | ||
Copy or Rename `config.json.example` to `config.json` and fill out the values: | ||
|
||
- [ ] Don't forget to run `injector/https.exe` to bot work! | ||
|
||
```.json | ||
{ | ||
"apiKey": "YOUR_API_KEY", | ||
"twitch": { | ||
"connection": { | ||
"reconnect": true, | ||
"secure": true | ||
}, | ||
"identity": { | ||
"username": "Nanotect_", | ||
"password": "YOUR_TMI_OAUTH" | ||
}, | ||
"channels": ["nanotect_"] | ||
} | ||
} | ||
``` | ||
|
||
## 🔩 Features & Commands | ||
|
||
> Note: The default prefix is '!' | ||
> Your can settings all in Folder `Settings` | ||
> Optional: [] | Required: () | ||
💫 **General Commands!** | ||
- `!request (link)` - Request Song | ||
- `!skin` - Check Current SKin | ||
- `!ppfc` - Check PerfermancePoint When FullCombo | ||
- `!nowplaying` - Check Nowplaying | ||
## ❣ Contributors | ||
|
||
## 📝 Credits | ||
Developed by [Adivise](https://github.com/Adivise) | ||
<a href="https://github.com/Adivise/SpaceTime/graphs/contributors"> | ||
<img src="https://contributors-img.web.app/image?repo=Adivise/SpacePlay" /> | ||
</a> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"apiKey": "YOUR_API_KEY", | ||
"twitch": { | ||
"connection": { | ||
"reconnect": true, | ||
"secure": true | ||
}, | ||
"identity": { | ||
"username": "Nanotect_", | ||
"password": "YOUR_TMI_OAUTH" | ||
}, | ||
"channels": ["nanotect_"] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,26 @@ | ||
const tmi = require("tmi.js"); | ||
const { Collection } = require("@discordjs/collection"); | ||
const config = require("./settings/config.js"); | ||
const { I18n } = require("locale-parser"); | ||
const { BanchoClient } = require("bancho.js"); | ||
|
||
let options = { | ||
connection: { | ||
reconnect: true, | ||
secure: true | ||
}, | ||
identity: { | ||
username: config.USERNAME, | ||
password: config.OAUTH, | ||
}, | ||
channels: [config.CHANNEL], | ||
}; | ||
const fetch = require("node-fetch"); | ||
|
||
process.on('unhandledRejection', error => console.log(error)); | ||
process.on('uncaughtException', error => console.log(error)); | ||
|
||
const client = new tmi.client(options); | ||
|
||
client.config = require("./settings/config.js"); | ||
client.owner = config.OWNER; | ||
client.i18n = new I18n(config.LANGUAGE); | ||
|
||
const bancho = new BanchoClient({ username: config.OSU_NAME, password: config.OSU_PASS }); | ||
|
||
client.bancho = bancho; | ||
const client = new tmi.client(require("./config.json").twitch); | ||
|
||
/// Load Twitch Package | ||
["aliases", "commands"].forEach(x => client[x] = new Collection()); | ||
["loadCommands", "loadEvents", "loadBancho"].forEach(x => require(`./handlers/${x}`)(client)); | ||
|
||
/// Start Bancho Client | ||
bancho.connect().then(() => { | ||
console.log("[INFO] Connected to Bancho!"); | ||
}); | ||
|
||
/// Start Twitch Client | ||
client.connect().then(() => { | ||
console.log("[INFO] Connected to Twitch!"); | ||
|
||
client.on("message", async (channel, tags, message, self) => { | ||
const prefix = "!" | ||
if (!message.startsWith(prefix)) return; | ||
const args = message.slice(prefix.length).trim().split(/ +/g); | ||
const command = args.shift().toLowerCase(); | ||
|
||
if (command == "np" || command == "nowplaying") { | ||
const response = await fetch(`http://127.0.0.1:24050/playing`).then(res => res.json()); | ||
client.say(channel, `@${tags.username}, Beatmap: https://osu.ppy.sh/beatmapsets/${response.menu.bm.set}#/${response.menu.bm.id} | Mods: ${response.menu.mods.str}`); | ||
} else if (command == "skin") { | ||
const response = await fetch(`http://127.0.0.1:24050/playing`).then(res => res.json()); | ||
client.say(channel, `@${tags.username}, Skin: ${response.settings.folders.skin}`); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.