GithubHelp home page GithubHelp logo

nattadasu / ryuuryuusei Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 2.5 MB

Find your profile and your favorite media titles with Ryuuzaki Ryuusei ๐Ÿš€

Home Page: https://nttds.my.id/ryuusei

License: GNU Affero General Public License v3.0

Python 99.94% Shell 0.06%
anilist anime bot discord discord-bot interactions-py jikan myanimelist nekomimi privacy-by-design

ryuuryuusei's Introduction

Natsu Tadama (@nattadasu)

Github Metrics

Guestbook

Try to sign on my guestbook at nattadasu/nattadasu#1 (๏พ‰โ—•ใƒฎโ—•)๏พ‰*:๏ฝฅ๏พŸโœง

Tutturu~ here is my sign.. ๐Ÿ˜บ -@yezki

Signed by barbarbar338 :D -@barbarbar338

uwaaaaa -@pampampam999

GitHub Activity

  1. ๐Ÿ—ฃ Commented on #4247 in balena-io/etcher
  2. ๐Ÿ—ฃ Commented on #4150 in balena-io/etcher
  3. ๐Ÿ—ฃ Commented on #771 in jarnedemeulemeester/findroid
  4. โ— Opened issue #771 in jarnedemeulemeester/findroid
  5. ๐Ÿ—ฃ Commented on #82 in tranxuanthang/lrcget

ryuuryuusei's People

Contributors

deepsource-autofix[bot] avatar deepsource-io[bot] avatar dependabot[bot] avatar fossabot avatar imgbotapp avatar nattadasu avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fossabot

ryuuryuusei's Issues

Known Bugs and Feature Suggestions

  • AniList not found may send both err json
  • Prefer to use context if user is 404 in AniList rather AniList err message
  • Add warning if user haven't link their AniList if registered or not
  • Occasionally KeyError on Jikan user data with key data (expected issue on caching) Kinda solved?
  • AniList manga may show "and 0 more" if tags and genres exactly 20
  • Add proper delimiter for counters (votes, chapters, volumes, episodes)
  • Add year if user consumed >12 months
  • Better phrase to tell user that they can lookup their profile without registering or linking
  • Add a way to ignore commands from serversettings command group if a group enabled in some channel, but want to keep several subcommand forbidden to use Unplanned
  • #188
  • Introduce cooldown
  • Fix Lastfm unable to showcase profile
  • #159

Replace themes.moe to animethemes.moe

Based on my observation, we can create a custom slug by:

  1. Take an anime title from MyAnimeList
  2. Remove any characters outside [\w\- ]+ in Regex
  3. Use slugify.slugify to safely convert the link to slug
  4. Modify the slug to use underscore (_) than a dash
  5. Link to https://animethemes.moe/anime/:slug

Drop Discriminator from Username if Found

Description

In some actions that related to previewing or saving Discord's old user identification system (username with discriminator number), create a function to not show discriminator with its pound/hash tag if user had changed theirs to new user identification system (handle name).

This behavior will be a temporary measure before Discord ends discriminator globally.

Implementation Details

  1. Create a function in common module (modules/commons.py)
  2. Create a function to check and return username
  3. If discriminator value is either 0, "0", or None, returns only handle name.
  4. However, if user still has discriminator, renders completely the username with discriminator + pound tag.

Escape Characters on Last.fm Command

If someone listened to an artist/track that contains left bracket ), hyperlink would break due to that.

Possible solutions:

  1. Only escape left bracket to percent entity.
  2. Manually split the links by slash / and escape all characters that might break markdown.

Add Confirmation if User wanted to remove, unlink, or changing language

Similar to how /register, /* search, and /serversettings register, warns user if they really wanted to delete their data, unlink a platform, or changing to (unfamiliar) language.

Implementation example:

async def unregister(ctx):
  # ...
  await ctx.send(embed=embed,
                 components=interactions.Button(label="Confirm",
                                                style=interactions.ButtonColor.DANGER,
                                                custom_id="user_confirm_action"))

@interactions.ComponentListener("user_confirm_action")
async def user_confirms(ctx):
  # rest of logic

[relations show]: SIMKL may unable to fetch IDs if platform is anime tracking sites

If User wanted to lookup relation from platforms neither Trakt, IMDb, TMDB, TVDB, and SIMKL, the relation data from SIMKL may not exist.

Possible culprit:

diff --git a/classes/simkl.py b/classes/simkl.py
index afe7477..7804c98 100644
--- a/classes/simkl.py
+++ b/classes/simkl.py
@@ -316,7 +316,7 @@ class Simkl:
             )
         params[f"{provider}"] = media_id
         async with self.session.get(
-            f"{self.base_url}/search/media_id", params=params
+            f"{self.base_url}/search/id", params=params
         ) as response:
             if response.status == 200:
                 data = await response.json()

Reference: https://simkl.docs.apiary.io/#reference/search/id-lookup/get-items-by-id

(PYL-E1123) Unexpected keyword argument in function call

Description

The function call has passed a keyword argument that doesn't correspond to one of the function's parameter names. This is an error.

Occurrences

There is 1 occurrence are 2 occurrences (on a freaking same function) of this issue in the repository.

See all occurrences on DeepSource โ†’ app.deepsource.com/gh/nattadasu/ryuuRyuusei/issue/PYL-E1123/occurrences/

edited by @nattadasu himself, expect passive aggressive he wrote here as he a bit dumbass

AniList Manga summary may not show "Read more on AniList" on Tagline + Followup Paragraph if Paragraphs more than 2

Description

As the title suggest, the bug appears when user showcasing a manga information from AniList from any method. Summary/description/synopsis with more than 2 paragraph will not show additional context to let user know if there's continuation if first paragraph is less than 150 characters (aka tagline) and less than 1000 chars on 2nd paragraphs

Possible Resolution

Create a logic to count total paragraph, if there's still more than 2 and 2nd paragraph is under 1000, force show the context.

Possible Occurences

There's possibility that this bug also occurs in /anime, /tv, and /movies. Thorough checking is required

Add Application Context to Showcase Title from Supported Link

Description

Currently, Ryuuzaki Ryuusei allows users to showcase information about Anime, Manga, TV shows and movies manually. However, there is a missing feature related to the context menu when someone shares a supported site URL (such as MyAnimeList, AniList, Kitsu, Shikimori, Trakt, Anime-Planet, etc.). This feature request aims to address this issue by adding application context to showcase the title from the supported link.

Proposed Feature

The proposed feature involves enhancing the message context menu (right-clicking) functionality when a user shares a supported site URL. When the user invokes the command, Ryuuzaki Ryuusei bot will utilize regular expressions (Regex) to extract the ID from the URL (e.g., MAL ID: 1 for https://myanimelist.net/anime/1). Subsequently, the bot will submit the extracted ID to the appropriate location where the context is invoked (e.g., /anime, /manga, /shows, /movies).

Expected Benefits

By implementing this feature, users will be able to seamlessly retrieve and showcase the title of the anime, manga, TV show, or movie when sharing a supported site URL via the message context menu. This enhancement will streamline the user experience and provide convenient access to relevant information without the need for manual input.

Implementation Details

The implementation of this feature requires the following steps:

  1. Enhance the message context menu to capture supported site URLs.
  2. Utilize regular expressions (Regex) to extract the ID from the shared URL.
  3. Implement logic to determine the type of content (anime, manga, TV show, or movie) based on the supported site URL.
  4. Submit the extracted ID and content type to the appropriate location where the context is invoked (e.g., /anime, /manga, /shows, /movies).
  5. Retrieve the title information corresponding to the ID and display it in the showcase or relevant output.

It is essential to handle errors gracefully and provide appropriate feedback to users if the URL or ID extraction fails. Additionally, the implementation should be modular and adaptable to support additional supported sites in the future, ensuring the bot remains versatile and up-to-date.

Relocate /profile * to /* profile for improved command permission override and platform-related commands

Description

Currently, the ryuuRyuusei Discord Bot has subcommands under the /profile command that allow users to showcase their profiles from various platforms such as MyAnimeList, AniList, Shikimori, Last.fm, and Discord. To enhance command permission override in server settings and accommodate additional platform-related commands, it is proposed to relocate the /profile * command to /* profile. This change will provide more flexibility in managing command permissions and enable the addition of more platform-specific commands.

Proposed Changes

  1. Relocate the /profile * command to /* profile to improve command permission override in server settings.
  2. Update the necessary code and documentation to reflect the new command location.
  3. Modify the command handler to accommodate future platform-related commands.

Expected Benefits

  1. Improved command permission control: The relocation of the profile command will allow server administrators to have finer-grained control over who can access and use the command, enhancing server management and security.
  2. Compatibility with additional platform-related commands: By relocating the profile command and introducing a general structure for platform-specific commands, the bot can easily support new features and commands related to different platforms, providing a more versatile user experience.
  3. Enhanced user customization: With the command permission override improvements, server owners can define specific roles or users who can access and use the profile command, allowing for more personalized profiles and user experiences.

Implementation Details

  1. Update the bot's command handler to recognize the new command structure (/* profile) and redirect it to the appropriate code.
  2. Modify the existing documentation and README file to reflect the command relocation and provide instructions on configuring command permissions.
  3. Consider implementing additional platform-related commands (e.g., /discord server for previewing server information) following the same pattern as the relocated profile command.

Additional Considerations

  1. Conduct thorough testing to ensure the proper functioning of the relocated command and any new platform-related commands.
  2. Provide clear instructions and examples in the documentation on how to configure command permissions and utilize the new command structure.
  3. Communicate the command relocation and any new features to existing users, highlighting the benefits and improvements.

Rewrite Proposal No. 2: Repo Restructure, Semver, Plugins

Description

This issue will be a proposal on how Ryuusei "pleases" developers by better folder structures and ability to install additional plugins from dedicated repo

Changes

  1. Restructure repo to be "pythonic" as possible
  2. Follow Semver convention for each releases, starts at 1.0.0
  3. Add a way to download and manage additional plugins
  4. Proper typing and resolve linting issues >:o
  5. Use TOML based config system than using .env, so plugin can add additional credential input there
  6. Move nattadasu/ryuuRyuusei to ryuuRyuusei/ryuuRyuusei
  7. Change database system from TSV to SQL
  8. Move dataclasses to specific models/ folder
  9. On /myanimelist profile, prefer scraping MyAnimeList HTML than relying on Jikan to avoid unwanted err
  10. Create ๐Ÿ‘ tests ๐Ÿ‘ for ๐Ÿ‘ every ๐Ÿ‘ modules
  11. Create a template for issue and pull request
  12. Create a documentation website/folder on how to run bot, usage, and developing plugin for the bot
  13. Drop language support as it kinda overhaul maintainer capability
  14. Implement video embed if a service has attached URL to YouTube on title showcase

Move MAL Showcase API from Jikan to MAL HTML

Due to continuous unknown/weird error from Jikan to lookup user profile like unable to fetch from uppercased username or straightforwardly unable to fetch the data at all, migrate the API from Jikan to MAL HTML parser in classes/html/myanimelist.py

However, the parser needs to be refined to be used without any issue

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.