Skip to content

Animel0verUwU/sbrbot

 
 

Repository files navigation

website
CodeFactor license stars lastcommit

discordjs typescript sequelize nodejs chartjs

install/setup

install nodejs (v16) here

install rust here

install all dependencies with npm i

create a ./config/ folder and put config.json inside it

config.json should look like this:

{
  "token": "create app here => https://discord.com/developers/applications",
  "prefix": "string",
  "osuClientID": "create client here => https://osu.ppy.sh/home/account/edit#oauth",
  "osuClientSecret": "create client here => https://osu.ppy.sh/home/account/edit#oauth",
  "osuApiKey": "get api key here => https://osu.ppy.sh/p/api",
  "ownerusers": ["user id"],
  "google": {
    "apiKey": "tutorial below",
    "engineId": "id_here"
  },
  "useScreenshotParse": false,
  "LogApiCalls": false,
  "LogApiCallsToFile": true,
  "enableTracking": true,
  "storeCommandLogs": true
}

rename TEMPLATE.sqlite to database.sqlite
to compile the bot the bot run tsc or npm run build
to run the compiled code run npm run run

to run the bot without checking for errors (or for other debugging purposes) use npm run test

image search setup

go to https://cse.google.com/cse/all or https://programmablesearchengine.google.com/controlpanel/all
press "Add"
in "what to search" enter "www.google.com/imghp"
in search settings, set enable "image search" and "search entire web"
press customise
copy the search engine id and paste it in the google.engineId field
scroll down and press "Get Started" on "Custom Search JSON API" (limited)
press "Get a Key" and create a new project
copy the key and paste it into the google.apiKey field

credits n stuff

config properties



token: bot token. go to https://discord.com/developers/applications, create a new app, and create a new bot under the bot section. copy the token from there

prefix: a string at the start of each message to detect if a message is a command. ie ! => !ping would ping the bot and ?ping or ping wouldn't.

osuClientID: the client id of an osu! api v2 app

osuClientSecret: the secret/token of an osu! api v2 app

ownerusers: an array of user ids stored as strings. users with these ids can use any command

google.apiKey: the api key of a google programmable search engine

google.engineId: the search engine id of a google programmable search engine

useScreenshotParse: enables/disables the detection of maps in screenshots. Can cause crashes due to high CPU and memory usage

LogApiCalls: enables/disables logging output to the console

LogApiCallsToFile: enables/disable console output being logged to logs/console.log. Still saves logs even if LogApiCalls is false

enableTracking: enables/disables osutrack. Users can still be added/removed but scores won't be updated.

storeCommandLogs: enables/disables logs being stored locally

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%