Coder Social home page Coder Social logo

jckli / picsiv Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 3.0 120 KB

๐Ÿค– Stylish Discord bot that allows the ability to see multiple anime art sources straight on Discord

Python 100.00%
pixiv pixiv-image pixiv-bot pixiv-illust discord pycord discord-py

picsiv's Introduction

my stack
languages: python, javascript/typescript, go, rust, html, css, java
frameworks: flask, jquery, react/next.js, tailwindcss, bootstrap
databases: mongodb

discord
config
image by @reoenl


picsiv's People

Contributors

jckli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

picsiv's Issues

restrict twitter capabilities to 'x' and 'twitter' domain names only by checking the SLD

Problem

after 03ede64, picsiv bot fixed not only x.com and twitter.com domain names but also corrected links fxtwitter.com and vxtwitter.com, turning them into fxvxtwitter.com and vxvxtwitter.com.

Suggestion

Updating the regex on L69 to instead use captures and break the url into several parts and have a check against the SLD would be an option.

This is the regex that I used on my implementation in my personal bot for several months before it being decommissioned to match twitter links:

(\w+://)(\w+)(.com/\w+/.+)

The second capture will match the SLD and is used to check whether it is an x or twitter, and only if the condition evaluates to true will the message be replaced.

Screenshots

Screenshot from 2023-12-30 20-02-09
Screenshot from 2023-12-30 20-02-26

Automatically delete the first link.

The tool is pretty cool, but having two previews of the same image makes the show unnecessarily heavy, would it be possible for the bot to automatically delete the link we put (the one with the truncated preview), in order to keep only the full version given by the bot?

Sans titre

The bot doesn't seem to be working

Ignoring exception in on_message
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/home/ubuntu/bluebot/pixiv/cogs/main.py", line 23, in on_message
data = pixiv.parse_hibiapi(json)
File "/home/ubuntu/bluebot/pixiv/core/pixiv.py", line 35, in parse_hibiapi
data = json.loads(data)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Ignoring exception in on_message
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/discord/client.py", line 382, in _run_event
await coro(*args, **kwargs)
File "/home/ubuntu/bluebot/pixiv/cogs/main.py", line 23, in on_message
data = pixiv.parse_hibiapi(json)
File "/home/ubuntu/bluebot/pixiv/core/pixiv.py", line 35, in parse_hibiapi
data = json.loads(data)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It seems that https://jackli.dev/picsiv has stopped working as well as the bot I personally fork.
Any ideas?

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.