add iteminfo command, change name of project to qweribot, fix ghcr publish url, add proper README.md

This commit is contained in:
2025-04-05 17:54:22 +02:00
parent 416ae34317
commit 564ead12c6
15 changed files with 164 additions and 99 deletions

19
src/commands/qbucks.ts Normal file
View File

@@ -0,0 +1,19 @@
import { createBotCommand } from "@twurple/easy-bot";
import { HelixUser } from "@twurple/api";
import api from "../lib/api";
import { getBalance } from "../lib/userHelper";
export default createBotCommand('balance', async (params, { userName, say }) => {
let user: HelixUser | null
if (params.length !== 0) {
user = await api.users.getUserByName(params[0].replace(/[@]/g, ''))
} else user = await api.users.getUserByName(userName)
if (!user) {
await say(`User ${params[0]} not found`)
return
}
const data = await getBalance(user)
await say(`${user.name} has ${data.balance} qbucks ${data.balance === 0 ? 'mandoooYikes' : 'mandoooSmile'}`)
}, { aliases: ['qbucks', 'qweribucks', 'bal'] })