Scratch for Discord
Web-ApplicationDiscord Server
  • 🏠Home
  • 👋Introduction
    • About Scratch for Discord
  • 🎓Tutorial
    • Block Usage
    • Bot Setup
    • Hosting
    • Slash Commands
  • 🧰Toolbox
    • 💼Base
    • ⚽Basic
      • Text
      • Math
      • Colors
    • 🔩Functions
      • Logic
        • If logic
        • State Machines
      • Loops
      • Lists
      • Variables
        • Var
        • Let and Const
      • Functions
      • Collections
      • Buffers
      • Objects
      • 💾Database
      • 📂Files
        • 🖼️Images
          • 📬Member Cards
      • 🔑Securing
    • 🖥️Discord
      • 🎨Embeds
      • 📻Interactions
        • ⚒️Slash
          • 📤Actions
            • 🧱Stacks
            • 🔎Reporters
          • 📥Events
        • Button
        • Menu
        • Context menu
        • Forms
      • 🥁Music
        • 📜Music Lyrics
      • 🗄️Servers
        • 😀Emojis & Stickers
          • 📤Actions
          • 📤Events
        • 🔰Roles
          • 📤Actions
            • 🧱Stacks
            • ❔Booleans
          • 📤Events
        • 🗓️Schedule events
          • 📤Actions
          • 📤Events
        • 📺Channels
          • 📤Actions
          • 📥Events
        • 💬Messages
          • 📤Actions
            • 📝Messages
            • 📢Threads
            • 🔗Webhooks
            • 🥳Reactions
          • 📥Events
          • 🔎Reporters
            • 📌Message Context
        • 👥Members
          • 📤Actions
          • 📥Events
            • 📭Leave
    • 🚀Applications
      • 📊Charts
    • 🌐Websites
      • Dashboard
  • 🖥️Interface
    • ⚙️Settings
    • ⌨️Hotkeys
    • ▶️Download & Run
    • 🖇️Git
  • 🪄Advanced
    • Custom Code
  • 🔗Links
    • 📦Packages
    • ❔FAQ
    • Web-Application
    • Discord Server
    • Source Code
Powered by GitBook
On this page
  • JSON
  • Creating a new database
  • Informations
  • Management
  • How to store money for different users?
  • MongoDB
  • SQLite
  • Replit

Was this helpful?

Edit on GitHub
  1. Toolbox
  2. Functions

Database

PreviousObjectsNextFiles

Last updated 1 year ago

Was this helpful?

Databases are used to keep your values after your bot has been rebooted.

unlike Variables, databases will keep it.

JSON

use this for "start" if you don´t understand any other, the most easiest database

Creating a new database

Informations

Output will be "world" because you previously set it in the database

Management

How to store money for different users?

MongoDB

  1. Create an account

  2. Create a new cluster "shared"

  3. That is free up to 500 MB of data

  4. click on connect

  5. connect your application

  6. copy the text

  7. change your username and password

  8. go to security / network access and add IP 0.0.0.0/0

  9. add your link to the connect to mongoDB block

SQLite

Basic Database that is used the most and everywhere.

works the same as JSON or MongoDB

Replit

Database made specially for Replit.com

It has less functions, but it exists.

you can only get, set and delete, so I have no idea why to use this one...

Works the same as JSON database, just you must create an account at

Install the plugin by running npm i git+ in the shell, and you are done!

🧰
🔩
💾
https://www.mongodb.com/
https://github.com/ahqsoftwares/quickmongo.git
Use this block to create a new database file
Example of managing a database, first check if the value either exists or is in NUMBERS, if not define it to 0
Example of giving message user point for every message