Skip to content

Repository files navigation

Volafile API (volapi)

https://img.shields.io/badge/style-BLACKED-black.svg?longCache=true&style=flat-square

Installation

pip3 install volapi

or for version with faster json module, orjson

pip3 install 'volapi[FAST_JSON]'

If you have it installed already but want to update:

pip3 install volapi -U

or

pip3 install 'volapi[FAST_JSON]' -U

Examples

Basic

# Import volapi and a Room interfacefromvolapiimportRoom# beepi will close at the end of this scopewithRoom("BEEPi", "SameFag") asbeepi:
# optional login using a passwordbeepi.user.login("hunter2")
# Upload a file under a new filename and save the idfid=beepi.upload_file("images/disgusted.jpg", upload_as="mfw.jpg")
# Show off your file in the chatbeepi.post_chat("mfw posting from volapi @{}".format(fid))

Listening

Getting urls of all the files in the room:

fromvolapiimportRoomwithRoom("BEEPi", "ScrappyBoy") asBEEPi:
BEEPi.listen(once=True)
forfinBEEPi.files:
print(f.url)

Some basic trolling can be achieved with just a few lines of code.

fromvolapiimportRoomwithRoom("BEEPi", "Stallman") asBEEPi:
definterject(msg):
if"linux"inmsg.lower() andmsg.nick!=BEEPi.user.nick:
BEEPi.post_chat("Don't you mean GNU/Linux?")
BEEPi.add_listener("chat", interject)
BEEPi.listen()

You can troll more than one room in parallel:

fromfunctoolsimportpartialfromvolapiimportRoom, listen_manywithRoom("BEEPi", "Stallman") asBEEPi, Room("HvoXwS", "Popman") asHvoXwS:
definterjectBEEPi(msg, room):
if"linux"inmsg.lower() andmsg.nick!=room.user.nick:
room.post_chat("Don't you mean GNU/Linux?")
definterjectHvoXwS(msg, room):
if"hollywood"inmsg.lower() andmsg.nick!=room.user.nick:
room.post_chat("Don't you mean GNU/Hollywood?")
BEEPi.add_listener("chat", partial(interjectBEEPi, room=BEEPi))
HvoXwS.add_listener("chat", partial(interjectHvoXwS, room=HvoXwS))
listen_many(BEEPi, HvoXwS)

Contributing

Just do whatever, and post a pull request. No guarantee of a merge tho!

If you cannot code, then please consider making a donation to our favorite charity "Cucks in Need Croatia" as one of our own, a user named "auxo", is politically procecuted for being a cuck in his native Croatia.

Releases

Packages

Used by

Contributors

Languages