Bot for handling osu! related commands/links written on Node JS
- Download ayantwitchbot ( Windows | Linux )
1.1 You can place it anywhere just avoid non-english letters and whitespaces in path - Download Gosumemory or StreamCompanion
- Start osu!
- Start Gosumemory or StreamCompanion
- Start ayantwitchbot ( ayanbot.exe | sh ./ayanbot )
Please note that Linux build is not tested and could be very unstable
You can also check out commands made by me or other people that's not included with bot
- !np - show current map
- !currentskin - show current skin
- !pp
accuracy
combo
mods
misses
- show pp for a current map
- *osu! beatmap link* - show beatmap info in Twitch Chat and send DM in osu!
- *osu! profile link* - show user info in twitch chat
For !np, !currentskin and !pp you need gosumemory or StreamCompanion
All .js command files placed at /commands/defaultCommands with executable file
You can write your own commands with javascript and use it in Bot
Script should be placed in /commands/ folder within executable file
If you wanna import additional files (Script, json, or Native Module), you can make folder for a command
You can see more examples in commands folder and defaultCommands folder
exports.conf = { // Configuration for commands name, aliases and regular expression
name: 'currentskin',
aliases: ['cs', 'skincurrent'],
modOnly: false,
regexp: { // If you don't need regular expression you can simply delete this object
only: false, // If true, command will be called only by regexp
value: '/skin?/g'
}
}
exports.run = async (client, channel, author, value) => {
const data = await client.gosu.data() // fetch data from gosumemory (./api/gosu.js)
if (!data) return // If no data - return
client.twitch.say(channel, `Current skin: ${data.settings.folders.skin}`)
}
By default client
object has 5 main properties
client.twitch
- a tmi.js Client classclient.twitch.say(channel, 'something')
- say something in twitch chat
client.bancho
- a bancho.js Client classclient.gosu
- an object for getting osu data from osu memory readers like gosumemory or streamcompanion- (async)
client.gosu.data()
- get data from osu! memory reader
- (async)
client.ojsama
- an ojsama module with custom function propertyparse
client.ojsama.parse(osuReaderData, [modes = '+HDDT', acc = '100%', combo = '2000x', miss = '0miss'])
- returns an object with total pp, accuracy etc.
client.logger
- a logger for console. See modules/logger.js for more information
const myAnotherScript = require(__dirname+'//anotherscript.js') // If file placed within script
const myJson = require(__dirname+'//myJson.json')
const fs = require('fs') // You still can import Node js modules and modules listed in package json
- Use
process.cwd()
if you need executable path
All data specified in config setup will be placed in config.json within executable file
osuUsername
- your osu! username. Need for osu! chat (beatmap requests)osuApiKey
(https://osu.ppy.sh/p/api) - your osu!api key. Need for getting beatmap info and user infoosuIRCPassword
(https://osu.ppy.sh/p/irc) - your osu! IRC password. Need for osu! chat (beatmap requests)twitchBotToken
(https://twitchapps.com/tmi) - twitch TMI Token. You can create another twitch account for bot and use its token insteadtwitchChannelName
- your twitch channel nameprefix
- command prefix (Default:!
)langauge
- bot languagedebug
- iftrue
console will output additional dataautoUpdate
- set tofalse
if you want to manually update your botgosuPort
- gosumemory port (Default:24050
)timeout
- Twitch Chat global timeout in milliseconds (Default:1500
)
{
"osuUsername": null,
"osuApiKey": null,
"osuIRCPassword": null,
"twitchBotToken": null,
"twitchChannelName": null,
"prefix": "!",
"language": "en_US",
"debug": false,
"autoUpdate": true,
"gosuPort": 24050,
"timeout": 1500
}