Giter Site home page Giter Site logo

fisherbot's Introduction

FISHERBOT

A weird school project

Requirements

Generation of SQLite3 .db file and .sql scripts

Starting your own Discord bot with the bot script

  • discord.py for python

  • General Discord bot knowledge

    • Create bot user
    • Get bot user token
    • Add bot user to server
    • Add message content intent
    • etc.
  • Create bot_token.py with the following content:

    token = "YOUR_TOKEN_HERE"
    

Bot Commands aka HELP

  • f to fish
  • inv to access your inventory
  • bal or balance to view current gold balance
  • shop for the shop help menu
    • shop <rarity> to view sell prices of fish for a rarity
  • sell to sell items
    • sell <amount> <fish>
    • sell 1 Salmon <--- CASE SENSITIVE FISH NAME!
    • sell fish to sell all fish
    • sell junk to sell all junk
    • sell all to sell both fish and junk
  • xp to check total xp
  • rods to viewrods all purchasable rods
  • buy rod <rod name> to buy the rod (use name given by rods)
  • area to see your current area
    • area <num> to set your area
  • profile to show off your profile
    • profile @user to see someone else's profile

Understanding dbf.py

dbf.py contains all of the database interation functions used in bot.py. You can write your own program using these functions and basically piggyback on this database if you'd like. Keep in mind nothing is completely finished on the front-end side.
Basically:

  • Read the SQL statements in db.execute() function calls
  1. Look at the database diagram
  2. ??????
  3. Don't understand because it's outdated

bot.py

Run this to run the bot. It's as simple as that. I haven't properly formatted this file for a true discord bot developing experience, but it's functional. Realistically I should be using actual bot commands instead of looking for a certain string for every message a user sends. Oh well.

TODO

  • SQL script generator
  • fix terrible string replace

Generating SQL scripts and database with gen_sql.py

So, there's a script called gen_sql.py in this repo. If you want the SQL DROP/CREATE for the database, run it. Oh, before you run it...

Configuration

Look for the section configurables near the top of the script

drop

  • Set True if you want changes to be committed to the fisherbot.db file
  • Set False if you do not want any changes to be committed to fisherbot.db

stdout

  • set True if you want the SQL script to be output to stdout
    • this is useful if you want to pipe the script into something, or write it to a single file directly from the command line
  • set False to keep the normal verbose/debug outputs

toFile

  • set True if you want individual SQL scripts for each table to output to ./sql/
  • set False if you do not want scripts to be output

include_user_data_tables

  • set True to include USER DATA CONTAINING TABLES in the script
  • set False to avoid USER DATA CONTAINING TABLES in the script

fisherbot's People

Contributors

richiecc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.