Answer the question
In order to leave comments, you need to log in
How to make a command to encrypt a message?
I am developing a bot. I want to make commands like these:
bot cipher *text to be encrypted* in base64
bot decrypt *encrypted text*
I work with the vk_api library for peton.
I tried to do it my way:
import base64
dhistory = vk.messages.getHistory(peer_id=peerid,count=1,)
text = dhistory['items'][0]['text']
dhistory = "бот шифр "
b64 = text.split(' ')[-1]
if text == "бот шифр " + b64:
b64 = text.split(' ')[-1]
s64 = base64.b64encode(b64)
vk.messages.send(peer_id=peerid,message=s64)
Answer the question
In order to leave comments, you need to log in
...
s64 = base64.b64encode(b64)
...
b64 = text.split(' ')[-1]
b64_to_bytes = str.encode(b64)
s64 = base64.b64encode(b64_to_bytes)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question