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.1.tar.gz
(12.0 kB
view hashes)
Built Distribution
Close
Hashes for social_ethosa-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 690d8ab1ab785c694a20c852f6aed84d497b5d8796feb5a8572b5833e2f7f763 |
|
MD5 | 6757949e039fcf35d4dd6ef84fd13070 |
|
BLAKE2b-256 | a749bd29da806ab39ebdb1a1fbcf30a82f0471c11d5822712e33120f9937e845 |