Coder Social home page Coder Social logo

no767 / kumiko Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 6.0 11.5 MB

A multipurpose Discord bot built with freedom and choice in mind

Home Page: https://kumiko.readthedocs.io/en/latest/

License: Apache License 2.0

Python 98.38% Dockerfile 0.23% Makefile 0.15% Shell 1.07% Batchfile 0.17%
discord multipurpose-discord-bot python anime kumiko

kumiko's People

Contributors

deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar github-actions[bot] avatar imgbotapp avatar kennethsequeira avatar no767 avatar snyk-bot avatar thesilkky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kumiko's Issues

[Task] Build Kumiko's GWS API

Task Description

maybe django api, or fastapi. This will be used to retrieve assets from the api in order to then give back to the user

[Task] Quests for Lavender Petals

Task Description

Each guild will need to set up their own "server account" and feed it with a set amount of money (maybe coming from their own accounts). and the owner can create different "quests" that would allow for the users to complete. like it could be earn this much coins, or etc. this allows for far more engagement with the users, and allows for freedom and control over it

Just cleaning lines

Related to a problem?

You can probably reduce and make the lines of code cleaner in the embing on top-gg.py

embedVar.add_field(
                        name="Long Description",
                        value=str(getOneBotInfo["longdesc"])
                        .replace("\r", "")
                        .replace("\n", ""),
                        inline=False,
                    )
                    embedVar.add_field(
                        name="Short Description",
                        value=getOneBotInfo["shortdesc"],
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Prefix", value=getOneBotInfo["prefix"], inline=True
                    )
                    embedVar.add_field(
                        name="GitHub",
                        value=str(getOneBotInfo["github"])
                        .replace('"', "")
                        .replace("'", ""),
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Website",
                        value=str(getOneBotInfo["website"])
                        .replace('"', "")
                        .replace("'", ""),
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Invite",
                        value=str(getOneBotInfo["invite"]),
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Points",
                        value=str(getOneBotInfo["points"]),
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Certified Bot",
                        value=str(getOneBotInfo["certifiedBot"]),
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Owners",
                        value=str(getOneBotInfo["owners"]).replace("'", ""),
                        inline=True,
                    )
                    embedVar.add_field(
                        name="Tags",
                        value=str(getOneBotInfo["tags"]).replace("'", ""),
                        inline=True,
                    )
                    await ctx.send(embed=embedVar)

Solution

Something like

for key, val in getOneBotInfo.items():
    embedVar.add_field(
    name = key,
    value = val.replace("\r", "").replace("\n"),
    inline=False,
)

could probably do the job

Describe the Alternatives

No response

Anything else?

No response

Is there an existing feature request for this?

  • I have searched the existing feature requests

[Task] Checklist before deploying v0.4.0

Task Description

Targeted Release Date: Nov 26, 2022

Here's a list of stuff that needs to be done before Kumiko v0.4.0 goes live. This list will be changed and new ones will get added later on

  • Audit all economy commands
  • Audit all additional commands (not from Rin)
  • Globally roll out all slash commands
  • #158
  • #157
  • Update Docs
  • Fix unbanning user issue
  • Add a global error handler for no permissions
  • #160
  • Rely on user perms and roles instead of bot perms for admin cmds
  • #162
  • #167
  • #172
  • Clean up code layout
  • DB migrations for MongoDB (check Beanie's docs) (This can be only used on replica sets, which Kumiko does not use)
  • Remove unused coroutines for eco package

[Task] Add Admin Logs

Task Description

saves to the postgres db, and allows admins to check for bans and stuff

[Task] Add warnings for moderation commands

Task Description

There should be an option to use a /admin warn to warn a user of their actions. This will get logged and would be available for the moderators to look at

[Task] Genshin Impact Wish Sim

Task Description

This was an idea from one of my friends, which to include a system to allow users to basically get items or characters. This will probably not be integrated within the economy system, since it makes no sense to do so. will require postgresql db for user inv storage

[Task] Finish Genshin Wish Sim

Task Description

The GWS is almost done. here's a checklist of the stuff that needs to be done before it is complete:

  • Attach star rank chances
  • Add another 35-50 characters and/or items to the WS DB (this makes the amount of rows to 100+. Add more as needed)
  • Remove duplication with multiple wishes
  • Add the images and UUID tag them (#132 takes care of that)
  • Add a system to inc the amount of that item by a certain amount if that user already has it in their inv
  • Add multiple wishes command
  • Dump and upload CSV and SQL dump files for the ws_data in the postgres db
  • Add the code to render and place the assets in the wish embeds
  • Re-upload CSV and SQL dump files for the ws_data table in the PostgreSQL DB

[Task] Add Seeder for PostgreSQL

Task Description

The current idea is to run the postgres-init script (or another one that is very similar more than likely) and copy that along the bot file. Then we only run that script when the docker container is first started up. This essentially "seeds" the database and creates the table automatically

[Task] Migrate from SQLAlchemy ORM to Tortoise ORM

Task Description

There is a reason behind this move. Writing out a ton of methods for SQLAlchemy ORM for Kumiko takes way too long and isn't as easy to build. So the idea is to use something like Tortoise ORM. Much faster, and meant for asyncio. SQLAlchemy ORM async is basically a shoehorned version of their sync version, but instead just using their async sessionmaker instead. SQLAlchemy ORM is way way too slow for Kumiko now, so the most logical decision is to go to Tortoise ORM

Modules to migrate

  • Genshin Wish Sim
  • Eco User
  • Eco User Inv
  • Eco Quests
  • Admin Logs
  • Marketplace (from MongoDB)

Modules to Add

  • Server Profile / Config

Models Created

  • Genshin Wish Sim
  • Eco Marketplace
  • Eco Auction House
  • Eco User
  • Eco User Inv
  • Eco Quests
  • Admin Logs

[Task] Organize all commands

Task Description

Kumiko needs to have her commands organized. So this means we need to sort them and to make sure that they are in logical order

List of stuff that needs to be done:

  • Subclass eco commands and / or rename them

postgress-init.py fault

hi, I created a postgress server on proxmox with all needed in .env
when I start command from /scripts
python postgres-init.py

I get fault.

root@ubuntu:~/Kumiko/Bot# cd ..
root@ubuntu:~/Kumiko# cd scripts/
root@ubuntu:~/Kumiko/scripts# python postgres-init.py 
Traceback (most recent call last):
  File "/root/Kumiko/scripts/postgres-init.py", line 42, in <module>
    asyncio.run(main())
  File "/root/.pyenv/versions/3.10.6/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1501, in uvloop.loop.Loop.run_until_complete
  File "/root/Kumiko/scripts/postgres-init.py", line 34, in main
    await utils.initUserTables(uri=CONNECTION_URI)
  File "/root/Kumiko/Bot/economy_utils/eco_user.py", line 49, in initUserTables
    engine = create_async_engine(
  File "/root/.pyenv/versions/3.10.6/lib/python3.10/site-packages/sqlalchemy/ext/asyncio/engine.py", line 43, in create_async_engine
    sync_engine = _create_engine(*arg, **kw)
  File "<string>", line 2, in create_engine
  File "/root/.pyenv/versions/3.10.6/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 309, in warned
    return fn(*args, **kwargs)
  File "/root/.pyenv/versions/3.10.6/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 518, in create_engine
    u = _url.make_url(url)
  File "/root/.pyenv/versions/3.10.6/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 725, in make_url
    return _parse_rfc1738_args(name_or_url)
  File "/root/.pyenv/versions/3.10.6/lib/python3.10/site-packages/sqlalchemy/engine/url.py", line 781, in _parse_rfc1738_args
    components["port"] = int(components["port"])
ValueError: invalid literal for int() with base 10: 'None'
root@ubuntu:~/Kumiko/scripts# 

inside .env in /Bot directory

POSTGRES_PASSWORD = "password"
Postgres_IP = 192.168.87.5 
POSTGRES_USER = "kumiko"
Postgres_Database = "kumiko_eco_users"

When I go to the Database ip, I can login.

regards Remco

[Task] Auction House

Task Description

might replace the crime commands, since this kinda steals the idea from dank memer. but why not have an event once in a while where the whole marketplace gets auctioned. basically a way to reset the marketplace?

[Task] Explicitly set Redis connection pool in memory

Task Description

This way, all we need to do is to pull the connection pool object from the internal memory, and then connect to redis that way. This just implemented into Xelt.py, so might as migrate the idea over to Kumiko

[Task] Use Redis as a mid-layer for the Auction House

Task Description

Since each user will probably bid for the price, it's better to save that data onto Redis. then every 5 mins or so, it'll commit the data into postgres. This guarantees data persistence, while also achieving massive performance gains

[Task] Rank System for Kumiko's Economy

Task Description

Each user first starts off at rank 0. This determines what they can do. they can do like obtain jobs for their rank, etc. And with more wealth, and time spent using the economy system, their rank increases. upper ranks can access stuff like the auction house, and many other stuff. Higher ranks can also allow access to better paying jobs, etc. It's just like an xp system actually

Copied from #83

  • Each job gives you a base pay + bonus (to be added later). The amount of money you have determines your current rank. The algo will be an exponential function. For example, I have an job that earns me 50 petals per hour (just like US jobs), and my rank is 1. Over time, I get more petals, (50, then 50 more, and so forth) and once I reach to an certain amount of petals (say 2500 for example), then my rank goes up. This essentially ties both the rank and jobs system together

[Task] IPC Workers for Web Dashboard Communication

Task Description

The idea behind this IPC server, which will be written using Quart, is that there is an Inter-Process Communication between the Quart server, and the bot. This way, we can send messages through and back, therefore gaining the ability to control the bot from the web rather. This, coupled with the Spring Webflux mircoservices and complex infrastructure plans, will surely be a stable enough system to hold the masses

[Task] Fix any bugs + stabilize v0.4.0 codebase

Task Description

Planning to release v0.4.0 soon. So the codebase needs to be stabilized in order to have a prod release (despite being in v0 alpha) soon. v0.4.0 ideally should be released in 2-3 weeks

Cogs to go over:

  • users.py
  • quests.py
  • petals.py
  • auction_house.py
  • marketplace.py (just have to go over the purchase cmd)
  • admin.py
  • gws.py

[Task] Daily Lootbox System

Task Description

Basically taking the idea from owo bot. There can be a daily lootbox system, where users can come back every single day, and get something new. and they can build up their inventory over time. unrelated to the economy system, or may be merged with the economy system

[Task] General cleanup

Task Description

There are a bunch of stuff that needs to be addressed, and remade

  • Dropping Admin Logs (one day, this will be merged into the general logging system)
  • Moving from Tortoise ORM to Prisma. Tortorise ORM basically isn't being maintained and is considered stale (the other issue is that Tortoise ORM's pydantic models feature is quite honestly annoying to work with). Instead, the Prisma client for Python, which is now being used on Akari, works very well. That project has a really nice migration tool built in
  • Consider switching from Pycord back into discord.py v2. Pycord V3 is already under the works, and if released, means that Kumiko will have to migrate to Pycord V3. Might as well migrate to discord.py instead.
  • Switching back from Coredis to redis-py. Mainly need it for RedisJSON support
  • Possible migration from GitHub projects to ClickUp or Monday.com

[Task] Add something like a hug feature from the owo bot

Task Description

This is pretty easy to do. Use Tenor's API (Rin already natively supports it), and search up a image of a hug. Then just do some formatting with the username (set the title to be like person a hugs person b, message here). Then send the whole entire thing as an embed

[Task] Crime Commands

Task Description

Just like dank memer, there should be commands added to earn coins via crimes (mainly theft, and drug dealing)

IM NOT ENDORSING THE USE OF DRUGS, OR THAT COMMITING CRIMES IS FINE. PLEASE DO NOT DO ANY OF THE THINGS IN REAL LIFE

[Task] v0.6.x Roadmap

Task Description

Goals

  • Only make the utils for the eco system
  • Only make some of the complex logic for the eco system (eg the purchasing system)
  • Migrate the codebase off to dpy

Current roadmap and tasks that need to be done

  • Development of nova-mq
  • Migrate user profiles, user inv, marketplace, and quests to Prisma
  • Async decorator for caching (rebuild the caching lib)
  • Implement unit tests for caching lib
  • Consolidate Rin's cogs into one category. So for example, the reddit cog can be converted into a cog that just has one of the commands, and that new cog w/ the new category has all of those
  • Sync mem cache implementation

<> and HTTP(S) links when adding an item to the marketplace

<> and HTTP(S) links will not work when adding a item to the marketplace. This is done to prevent spam links being put in (eg when someone decides to list a item with the title being the link to pornhub), and brackets are used to prevent XSS (Cross-Site Scripting) attacks from being used

Currently not allowed:

  • <> and all HTML tags
  • HTTP(S) links
  • IPv4 + Public IP Addresses
  • Profanity (will be decided if this will be shipped in the production release of Kumiko)

[Task] Jobs System

Task Description

Would be nice to have a jobs system. This jobs system is really what sets Kumiko apart from most multipurpose bots with an economy. Especially on how the ranks system works.

Moving forwards with the implementation, here are some ideas to be considered:

  • Each job gives you a base pay + bonus (to be added later). The amount of money you have determines your current rank. The algo will be an exponential function. For example, I have an job that earns me 50 petals per hour (just like US jobs), and my rank is 1. Over time, I get more petals, (50, then 50 more, and so forth) and once I reach to an certain amount of petals (say 2500 for example), then my rank goes up. This essentially ties both the rank and jobs system together
  • Once you reach a certain rank, you unlock features, such as bounties, (aka quests, aka tasks), and more
  • The higher the rank, the better the jobs are
  • Include a default set of jobs?

And here is the general checklist:

  • Add CRUD commands
  • Add list/unlist job commands
  • Add purge command
  • Add transfer (ownership) command (It just doesn't make sense to "transfer" a job away, when in reality, you kinda have to apply/quit for one instead)
  • Add remove by id command
  • Add an application system. Aka apply/quit commands. the max amount of jobs that one user can have is 3
  • Add the actual task running in the background that updates them as needed.

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.