Giter Site home page Giter Site logo

syntthetix / yuuki-bot Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 137.27 MB

A discord.js-based Discord bot for personal use (Not meant for public use, only one server at a time)

License: GNU General Public License v3.0

JavaScript 99.71% Procfile 0.29%
discord-bot discord-js mysql nodejs discordjs-commando

yuuki-bot's People

Contributors

dependabot[bot] avatar imgbot[bot] avatar qwertydelle avatar syntthetix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yuuki-bot's Issues

Add time capsule command

  • Allow the user to set a message to be sent in the general channel on a given date
  • All time capsule messages will send at a specific time of day (maybe 3pm EST)
  • New table in DB will be needed to store upcoming messages with their set dates
  • Each day at specific time, check all upcoming messages for a matching date and send those that match
  • Finally drop that message from the table

Need to update to discord.js v12

Upcoming discord API changes will cause v11 to no longer work, and the devs will no longer support it.

Updating to v12 needs to be done fairly soon to prevent the entire bot from breaking.

Add '.yu shinies' command to view shinies found

Would need to create a new table in the database (found_targets) with fields 'name', 'owner_id', and 'date_found'.

Command would use an SQL query to check target user's 'shinies_found' field, and store it as a variable. (Could also store their current target to display in the final embed)

The next SQL query would be "SELECT * FROM found_targets WHERE owner_id = targetUser.id ORDER BY date_found DESC LIMIT shinies_found"

The returned records would be all of the target user's previously found shinies, which could then be displayed in an embed.

Move RNG/shiny features to separate file

Just for the sake of cleaning up the code, moving all the RNG/shiny message features to a separate file and calling its methods from index.js would be ideal.

Create new file shiny.js in lib folder that will have methods for random reactions and shiny messages which go in module.exports{ } at the end.

Allow user to set target shiny pokemon, etc.

Add a '.yu target' command that takes one argument for what the user's target will be for the shiny message system. When the user finds a shiny message, check their target from the database and send a message that says they found that target.

Create shiny message tracker

Shortly more interesting application of the SQL database, would simply add a "shinies_found" attribute to each user record and increment upon finding a shiny message.

Would obviously also need a command to view number of shiny messages found by a user

Implement basic XP/leveling system

Once the SQL database has been created and fully implemented in the code, a simply XP system can be made to test what can be done with it.

ClearDB can't use LOAD DATA INFILE

Because of this limitation, I need to find a way to read the information in from a .csv file most likely, and use a mere 893 INSERT queries to import the data into the 'pokemon' table.

Definitely need to make sure that this only runs the first time the bot needs to import the data.

Bot crashes when adding new user to database

  • Most likely due to the bot trying to check if a message is shiny before it finishes adding the new user to the database
  • If so, fix by adding addNewUser function in xp.js that returns a promise and is awaited
  • If not, look at xp.js for other possible issues

Bot doesn't check whether or not Pokemon data needs to be loaded in before loading

  • Need to use an SQL query to check the length of one of the fields in the pokemon table
  • If length is greater than 0, return and don't try to load in all the data, and also skip the sprite path update
  • Without this, the bot will run out of the free 3600 queries on ClearDB Ignite in only two restarts, crashing the bot until the limit resets

Add automatic odds for different shinies

  • Add a column to pokemon-list.csv called 'odds', and add the same field to the pokemon table in the DB
  • Base odds for most Pokemon will be 1/512 or 1/1024 (need to decide on that)
  • Legendaries will mostly be 1/4096
  • Can assign specific odds on a per-pokemon basis if needed
  • Need to adjust the method of checking for shinies to use the user's target and that target's odds in the DB

[Feature Idea/Improvement] Add table in DB to hold channels with their IDs, possibly with command to assign them.

Is this idea meant to solve an existing problem?
Currently have to adjust channel IDs in constants.js in order to test or deploy the bot

Describe the solution this would provide.
Channel IDs would be assigned locally and on Heroku since those have two separate databases, so we wouldn't need to assign them ourselves in constants.js anymore

Describe alternatives you've considered.
May not need a command to assign channel IDs, but would probably be ideal.

Additional context
Also apparently issue templates are a thing, that's kinda cool.
Edit: I want to die

Add automatic Elementalist Lux picker for the Ner

  • Will use the Kayn RiotAPI wrapper
  • Meant to check for when we enter a match in League, then check if Noah picks Lux
  • Would then send a message (probably in assigned general channel) indicating which element Noah will start as

Add XP leaderboard command

This will be a new command (.yu lb/xplb).

This would get the xp of every person in the server, sort them by xp descending, and output an embed with the leaderboard.

Could add a daily update of rank and store rank as a field in the user's record in the database, so rank could be shown in output from .yu xp

Automatically clear prompts from commands after completing them

  • Currently, running through a set of prompts can lead to a large wall of text, which is an issue if used in the main text channel.
  • Adding a function in util.js that takes an argument for how many messages to clear in the current channel would allow auto-clearing of these prompts, keeping the main text channel clean.
  • Alternatively, finding a way to prevent prompts from being used in the main channel at all would solve this problem another way. (!inCommandChannel(msg) cannot be used in async run because the prompts are sent before that)

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.