mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 01:01:39 +01:00
move !modme and !getloot options to env variables
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
BOT_NAME=
|
||||
CHANNEL=
|
||||
MODS=
|
||||
COOLDOWN=
|
||||
CLIENT_ID=
|
||||
CLIENT_SECRET=
|
||||
REDIRECT_URI=https://qweri0p.github.io/url-params/
|
||||
|
||||
20
README.md
20
README.md
@@ -10,17 +10,17 @@ Here is the list of commands.
|
||||
|
||||
COMMAND|FUNCTION|USER|ALIASES
|
||||
-|-|-|-
|
||||
`!balance [target]`|List write the amount of money the user or the target user has.|anyone|`!bal, !qbucks, !qweribucks`
|
||||
`!inventory [target]`|Show inventory contents of user or the target user.|anyone|`!inv`
|
||||
`!getloot`|Give user a lootbox. This command has a cooldown that can be changed in `lootbox.ts`.|anyone|`None`
|
||||
`!stats [target]`|Show the stats of user or target user including users shot, TNT used and grenades lobbed of the current month.|anyone|`None`
|
||||
`!alltime [target]`|Show the stats of user or target user including users shot, TNT used and grenades lobbed of all time.|anyone|`None`
|
||||
`!timeout {target}`|Give the target user a timeout of 60 seconds. This requires 100 qbucks.|anyone|`None`
|
||||
`!balance [target]`|List write the amount of money the user or the target user has|anyone|`!bal, !qbucks, !qweribucks`
|
||||
`!inventory [target]`|Show inventory contents of user or the target user|anyone|`!inv`
|
||||
`!getloot`|Give user a lootbox. This command has a cooldown that can be changed with the `COOLDOWN` environment variable|anyone|`None`
|
||||
`!stats [target]`|Show the stats of user or target user including users shot, TNT used and grenades lobbed of the current month|anyone|`None`
|
||||
`!alltime [target]`|Show the stats of user or target user including users shot, TNT used and grenades lobbed of all time|anyone|`None`
|
||||
`!timeout {target}`|Give the target user a timeout of 60 seconds. This requires 100 qbucks|anyone|`None`
|
||||
`!use {item}`|Use a specific item. The user needs the specific item in their inventory. For items please look at the table below|anyone|`None`
|
||||
`!iteminfo {item}`|Gives a description of the requested item. Identical to [the item descriptions in this document](#items)|anyone|`!item`
|
||||
`!modme`|Gives the user moderator status. Only gives users moderator status if their name is in `modme.ts`|anyone|`None`
|
||||
`!modme`|Gives the user moderator status. Only gives users moderator status if their name is in the `MODS` environment variable|anyone|`None`
|
||||
`!give {target} {item} {count}`|Give a specific user a specific amount of an item. Negative amounts can be used to remove items|streamer|`None`
|
||||
`!vulnchatters`|Print how many users are vulnerable to TNT and grenade explosions.|streamer|`None`
|
||||
`!vulnchatters`|Print how many users are vulnerable to TNT and grenade explosions|streamer|`None`
|
||||
|
||||
### Items
|
||||
|
||||
@@ -98,7 +98,9 @@ Options with :bangbang: in the Required column need to be present for setup, and
|
||||
VARIABLE|DEFAULT|FUNCTION|REQUIRED
|
||||
-|-|-|-
|
||||
`BOT_NAME`|None|Set the name of the bot user for Authentification|:white_check_mark:
|
||||
`CHANNEL`|None| Set the name of the twitch channel to join|:white_check_mark:
|
||||
`CHANNEL`|None|Set the name of the twitch channel to join|:white_check_mark:
|
||||
`MODS`|None|List of users that can use `!modme` to give themselves moderator status|:white_check_mark:
|
||||
`COOLDOWN`|24 Hours|Cooldown between letting users get a lootbox with `!getloot` in seconds|:x:
|
||||
`CLIENT_ID`|None|Set the CLIENT_ID to authenticate the bot|:bangbang:
|
||||
`CLIENT_SECRET`|None|Set the CLIENT_SECRET to authenticate the bot|:bangbang:
|
||||
`REDIRECT_URI`|`https://qweri0p.github.io/url-params/`|The REDIRECT_URI set in the twitch dev console|:bangbang:
|
||||
|
||||
@@ -6,8 +6,10 @@ import api, { broadcasterAuthProvider } from './lib/api';
|
||||
|
||||
import { removeVulnChatter, vulnerableUsers } from './lib/timeoutHelper';
|
||||
|
||||
const channel = process.env.CHANNEL ?? ''
|
||||
const user = process.env.BOT_NAME ?? ''
|
||||
const user = process.env.BOT_NAME
|
||||
if (!user) { console.error("Please set the BOT_NAME environment variable."); process.exit(1) }
|
||||
const channel = process.env.CHANNEL
|
||||
if (!channel) { console.error("Please set the CHANNEL environment variable."); process.exit(1) }
|
||||
|
||||
const bot = new Bot({
|
||||
authProvider,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { createBotCommand } from "@twurple/easy-bot";
|
||||
import api, { broadcasterApi } from "../lib/api";
|
||||
|
||||
const MODS = ['qwerinope']
|
||||
const MODS = process.env.MODS
|
||||
if (!MODS) { console.error("Please set the MODS environment variable."); process.exit(1) }
|
||||
|
||||
export default createBotCommand('modme', async (_params, { userName, broadcasterId }) => {
|
||||
if (!MODS.includes(userName)) return
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { HelixUser } from "@twurple/api"
|
||||
import pb, { User } from "./pocketbase"
|
||||
|
||||
// const COOLDOWN = 1000 * 60 * 60 * 24 * 30 // 1000 milliseconds * 60 seconds * 60 minutes * 24 hours * 30 days
|
||||
export const COOLDOWN = 1000 * 60 * 15
|
||||
|
||||
export const COOLDOWN = !process.env.COOLDOWN ? 60 * 60 * 24 : Number(process.env.COOLDOWN)
|
||||
|
||||
interface lootboxReadyResult {
|
||||
result: boolean,
|
||||
|
||||
Reference in New Issue
Block a user