Skip to main content

The social ethosa library for Python

Project description

social_ethosa

The social ethosa library using Python.

Get vk access token here: https://vkhost.github.io/ (choose the Kate mobile.)

install: pip install social-ethosa --upgrade

usage:

from social_ethosa.vkcom import *

token = 'Your token here'

vk = Vk(token=token) # if you want auth to user
vk = Vk(token=Group_Access_Token, group_id='id your group') # if you want auth to group

@vk.on_message_new # handler new messages
def get_message(obj):
  peer_id = obj.peer_id
  message = obj.text
  vk.messages.send(message='hello vkcom!', peer_id=peer_id, random_id=0)

@vk.on_error # errors handler
def get_error(error):
  print(error.msg) # Example: No module named 'aa'
  print(error.line) # Example: 1
  print(error.code) # Example: ModuleNotFoundError

need help? no problem!

print(vk.help())
print()
print(vk.help('messages'))
print()
print(vk.help('messages.send'))

You can also use Smile to get smiley codes!

print(Smile('Улыбка'))
print(Smile('Красная книга'))
print(Smile().smiles) # it return ALL SMILEY CODES!

Example audio message:

from social_ethosa.vkcom import *

token = 'token group'

vk = Vk(token=token, debug=True, lang='ru', group_id='185684225')

@vk.on_message_new
def lol(obj):
    if obj.text == '/lol':
        response = vk.upload_audio_message(peer_id=obj.peer_id, file='mil_tokyo1.ogg')
        audio = f'doc{response["audio_message"]["owner_id"]}_{response["audio_message"]["id"]}'
        print(audio)
        vk.messages.send(attachment=audio, message='ban :|', random_id=random.randint(0, 100), peer_id=obj.peer_id)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

social-ethosa-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

social_ethosa-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file social-ethosa-0.1.0.tar.gz.

File metadata

  • Download URL: social-ethosa-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for social-ethosa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a386fdb1f2882b36149dafbdddd7fe7c4e24be25bbcf616e100470cbd42a303
MD5 85cb5c59f08af468b5e80d419c4d5eac
BLAKE2b-256 84d7bac1924274da9e3e3f16a3e3f3e2c85ba0bb61756616f4f5c51e547efeea

See more details on using hashes here.

File details

Details for the file social_ethosa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: social_ethosa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for social_ethosa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f39573bd3edf734ca6061e8da090f1367693fc9c216be6fad823aef5755260be
MD5 eb469bdf33dba97501b6a7c04917b61d
BLAKE2b-256 46b8266efdc7eb9046666cc56e23c92da8d6a7ceff68554e9a4a1bd8c8385507

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page