Giter Club home page Giter Club logo

pumpkin-fun's Introduction

Pumpkin.py

Maintenance GPLv3 license Formatted with Black

About

pumpkin.py is a Discord bot framework written in nextcord.

This code is just the core -- see other repositories to add more functions to your bot!

Documentation

Installation, development

We keep the technical documentation on ReadTheDocs.io. There you can find information on how to set up production instance or how to start with the development.

User guide

Running the bot is just a start. To see how you can manage the running instance, see our GitHub.io page.

Authors

pumpkin.py is mantained by sinus-x and Czechbol.

We also have several amazing contributors -- see them at the Contributors section on the right panel!

Legal

This project is licensed under the GNU GPL v3 license.

See Legal page on ReadTheDocs.io for more information.

pumpkin-fun's People

Contributors

418m avatar alexismanuel avatar arcascz avatar borekznovustvoritel avatar brblisko avatar charashenko avatar czechbol avatar dominikgalovic avatar ginffvhjl avatar ikachuu avatar jedla97 avatar karlass1 avatar nessyi avatar oswinska avatar roadside-picnicx avatar roastdeer avatar romelsk avatar sebgoliot avatar sinus-x avatar solumath avatar

Watchers

 avatar

pumpkin-fun's Issues

Fun: Implement animation caching

Currently the animations are being created from nothing. To optimise the gif functionalities (whip, pet, ...) we should come up with some kind of caching (so the images are saved for offline use). The problem is invalidation -- time-based? Event-based (what happens if an event comes when the bot is offline?)? FIFO based (only keep last n animations?)? A mix of them?

'randomcase' breaks on '*'

When the 'randomcase' argument starts with an asterisk *, it will cause multiple backslashes to be printed before the text itself:

- *foo*
~ \\\\\\\\\\\\\\\*foo*

We want to keep the formatting, the only thing that should be disabled is tagging users.

'seeking' should time-limit the items

There should be a limit on how many days the item can last. The default should be 90 days. I'll leave it up to the person taking this if the limit should be configurable guild-wide, or if it should be hardcoded. Either will do the job.

[Fun] Optimize relations

Actual database is highly ineffective. Every interaction is now getting inserted into DB and count is determined by COUNT(*) over all records.

This could be solved by adding value column. This column would agregate same type, giver and receiver interactions, which would decrease usage of space.

Weather: Complete the module

I've pre-made the database part of the module. This issue is intended to our "junior" developers, so they only have to recreate the API and user feedback part.

Instead of using the API Rubbergoddess uses, I'd recommend you to look into https://wttr.in/:help. It has JSON API output we could use, and we could add forecast as well (maybe as two-page ScrollableEmbed?).

It also has the v3. API interface, which could be use to add third page with a map of the area around (see the docs).

Optionally, the API should be contacted with Accept-Language: header with user's/guild's language preference, so the strings are localized.

The PR should target the weather branch, not main.

[Rgs] Port the 'librarian' cog

Port the librarian cog to this pumpkin.py repository.

Required changes:

  • New pumpkin.py translation system is used
  • pumpkin.py database scheme is used
  • Each guild should be able to set the default city for Weather command
  • Each member should be able to set the default city for Weather command (this command should notify the user about GDPR conditions, which we -- as in core bot developers -- can provide)
  • Respect rate limiting for the IP address lookup API

Feel free to reach out for clarification.

Weeb module is not working

The weeb module is not working, because the api is protected by cloudflare and have ddos protection by captcha (mostly skip without challenge). This causing api to return 403 error. There is need to wait for captcha challenge to success and api should return 200 again.

Here will be needed some investigation how to go around this api limitation and implement it.

Random: Update the 'pick' command

Instead of simply taking a list of arguments

async def pick(self, ctx, *args):

update the code so that the first two arguments are required. This will force the users to add at least two arguments to be picked from. It should still be possible to submit an unlimited number of arguments.

'deepfry' command

Create a command that would take one user image and "deepfry" it -- apply some deformations, hue and/or color shifts (use your search engine of choise for inspiration).

Use Attachment converter to load the image from the message.

Urban argument

In current situation if you want to use urban with phrase, you must put it into quotes, otherwise it says that it takes only one argument. The solution is to make the argument greedy (consuming all strings into one)

[Rgs] Port the 'shop' cog

Port the shop cog to this pumpkin.py repository.

This module depends on Karma module and should refuse to start without it. This issue is thus being blocked by pumpkin-py/pumpkin-boards#4.

Required changes:

  • New pumpkin.py translation system is used
  • pumpkin.py database scheme is used
  • New module name is 'names'
  • 'karma stalk' should be merged with 'karma get'

Feel free to reach out for clarification.

[Rgs] Port the 'random' cog

Port the random cog to this pumpkin.py repository.

Required changes:

  • New pumpkin.py translation system is used
  • aiohttp is used instead of requests

Feel free to reach out for clarification.

possible "highfive" output

After the second user confirms the highfive call the output could look something like this:

User 1 つ <reverse つ> User 2

[Fun] Highfive in thread

If you !highfive member in Thread, it says "You can't do that, they are not in this channel." even if that member is participating in thread.

[Bug] URL injection

It's possible to input URL special characters in the picsum command here:

size: str = "900/600"
        url: str = "https://picsum.photos/"
        if seed:
            url += "seed/" + seed + "/"
        url += f"{size}.jpg?random={ctx.message.id}"

Something like ../id/870/200/300?blur=2# works. Simply URL encoding input fixes the issue.

Pick command not work correctly

Hi when using pick command there were discovered incorrect behavior of this command. The problem is that the (https://github.com/pumpkin-py/pumpkin-fun/blob/main/rand/module.py#LL60C18-L60C18)[code] looking for ? but it's not depend on position where it's located.

For example:

-pick Monday Wednesday? Friday

It saying that there is not enough arguments, which is incorrect as there are 3 args.

When used this:

-pick Maybe "Did I drink enough?" Yes No

It just take last 2 arguments (yes and no) and Maybe is omitted.

In my point of view only the first argument should be checked if contains ?.

Possible workaround is use backtick ( ` ) for example

-pick Monday 'Wednesday?' Friday

Random: 'wpick' command

Weighted version of 'pick' (may be 'weighted-pick' as an alias).

This command would take a list of arguments, prefixed with an integer, separated by semicolon.

  • 30:a 20:b 50:c would have 30% probability of returning a, 20% probability of returning b, and so on.
  • 70:a b c would have 70% probability of returning a, and the rest would be split: 15% for b and 15% for c.

Sums over hundred should be allowed, but probabilities of items with no prefix would have a probability of 0%:

  • 60:a 120:b c would have 33% probability of a, 66% of b, and 0% of c.

Add ConfirmView to 'nickname' actions

'set' and 'unset' options should have a confirmation embed. The user should be shown their new nickname (in case of 'set'), the karma price. They should be able to both confirm and deny the action.

Fun: Better hug

When A hugs B, a simple hug emoji is sent:
(⊃・‿・)⊃ **name B**

The improvement: if B replies to A within some time period (one minute?), a more complicated emoji could be sent of both of them hugging:
**name A** (⊃・‿・)⊃\(・‿・)⊃ **name B**

Add fishing module

We had ?fish command in our previous bot, Rubbergoddess. Our folks quite enjoyed it.

You can take an inspration from its code, from Virtual Fisher bot or just think of something new. The module should support fishing, multiple fish types, extra stuff (think Minecraft's fishing system), inventory...

It could also work on the principles of Discord's Trick-or-Treat bot; you could start fishing and after a random amount of time an embed would show up, and you would have to claim it before it gets lost again.

It could also be an opportunity for custom-drawn images.

[Rgs] Port the 'meme' cog

Port the meme cog to this pumpkin.py repository.

Required changes:

  • New pumpkin.py translation system is used
  • pumpkin.py database scheme is used
  • Optionally, animation caching is implemented (focus on cache invalidation -- both event and time based)

Feel free to reach out for clarification.

[Rgs] Port the 'seeking' cog

Port the seeking cog to this pumpkin.py repository.

Required changes:

  • New pumpkin.py translation system is used
  • pumpkin.py database scheme is used

Feel free to reach out for clarification.

Ensure newlines aren't printed

Several commands are taking user input, but displaying its newlines can mess up the input. Some examples are:

  • weather (description)
  • picsum (footer)

Doing .replace("\n", " ") should be enough.

[Rgs] Port the 'animals' cog

Port the animals cog to this pumpkin.py repository.

Required changes:

  • New pumpkin.py translation system is used
  • pumpkin.py database scheme is used
  • Implement automatic deletion of old messages containing avatars (we shouldn't be keeping them for more than a week)

Because of legal reasons (see General Data Protection Regulation), this should be opt-in.

art-of-the-deal diacritics

Marlboro regular does not include some letters with diacritics like č fallback with ASCII character would be nice, or port some letters using existing ones if that is an option.

It is possible to port some letters relatively easily using fontforge like č, Č, Ď. Some other like ĺ, ľ would be harder.

[Amadeus] Migrate Urban

We need to migrate the Urban cog from Amadeus to Fun (Urban submodule).

See the cog here.

The cog doesn't use a database, just the unofficial Urbandictionary API. There's also a couple of python libraries you can use as wrappers but the implementation is so simple I don't think it's necessary to use a library for this. This will be fairly a easy port.

Feel free to rewrite any part of the cog to make it better/more readable

[Amadeus] Migrate Weeb

We need to migrate the Weeb cog from Amadeus to Fun (as Weeb submodule).

See the cog here.

The cog doesn't use a database and is using the Nhentai API so this will be fairly a easy port.

Please rewrite using the aiohttp library instead of requests. Do not use the legendary hentai library as it uses requests which would slow the bot down.

Feel free to rewrite any part of the cog to make it better/more readable

[Rgs] Port 'actress' cog

Port the actress cog to this pumpkin.py repository as 'macros' module.

Required changes:

  • New pumpkin.py translation system is used
  • pumpkin.py database scheme is used
  • Reactions:
    • Database is used, instead of JSON file
    • Only text content is possible, no images
    • Reactions are per-guild
  • Do not port the 'image' command group, it is not necessary

Feel free to reach out for clarification.

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.