Skip to content

Zulqis/PythonBot

Repository files navigation

DiscordCurrency

Discord bot that manages user currency with a google spreadsheet database.

Setup

  1. Setup your Google Spreadsheets Database

    1. Go to https://console.developers.google.com/
    2. Create a new project and select ENABLE APIS AND SERVICES
    3. Select Google spreadsheets and setup your credentials
    4. You'll receive a .json file which you'll need to put with your project files (You can rename it to client_secret.json)
      • If you don't get a .json file, select the service account from the account listing.
      • Go to the keys tab and click Add Key --> Create Key --> JSON
    5. Create a new google spreadsheets doc
    6. Share your doc with your client_email found in your client_secret.json
    7. Set your table headers as these:
    table header
  2. Create a .env file and set these variables:

    1. Your Discord Bot Login Token
      • TOKEN=<Discord_Login_Token>
    2. Your Google Spreadsheet Token
      • SHEET_TOKEN=<Google_Sheets_Token>
      • Example:
    token
  3. Running the bot

    1. npm install
    2. node index.js

Credentials

  1. Which API are you using?
    • Google Sheets API
  2. Where will you be calling the API from?
    • Web server
  3. What data will you be accessing?
    • Application Data
  4. Are you planning to use this API with App Engine or Compute Engine?
    • No
  5. Create your own service account name
  6. Role should be: Editor
  7. If asked for key type select: JSON
  8. Don't fill out Optional
  9. Create Credential

Dependencies

  1. Dotenv(https://www.npmjs.com/package/dotenv)
  2. google-spreadsheet(https://www.npmjs.com/package/google-spreadsheet)
  3. Discord.js(https://discord.js.org/#/)

Usage

Command Description
!add @user... [optional] <currency_amt> Adds one/multiple users to the google spreadsheets database
!list @user... / !list all shows a specific user's or everyone's wallet
!remove @user Removes a user from the database
!transfer @user... <amount> Transfers money from your wallet to one/multiple users
!update @user... <currency_amt> change one/multiple user's currency amt
!wallet shows how much you have in your wallet

Showcase

*User is a placeholder for your discord username

  1. Database Example

database example

  1. Bank

command

bank

  1. Wallet

wallet

# Command Help
if message.content.startswith(';help ronin-add'):
    embedVarronin = discord.embed(title="For ;ronin-add 0x", color=0xFF10F0)
    embedVarronin.add_field(name="[Ronin address]", value='1. Copy your Ronin address without "RONIN:" content\n2. Paste it beside 0x without space',inline=False)
    embedVarronin.add_field(name="[Share percentage]", value="Look for your share percentage (usually '65%' in TTB)", inline=False)
    embedVarronin.add_image(url="https://i.imgur.com/VM5GyYt.png")
    await message.channel.send(embed=embedVarronin)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages