Answer the question
In order to leave comments, you need to log in
How can I make the function appear in the main script?
I created my own library, made the following function in it:
def free():
client = FreeKassaApi(
first_secret='',
second_secret='',
merchant_id='',
wallet_id='')
balance = client.get_balance()
elif body.lower() == "free-kassa ":
if sg.adminAut(id, "data/admin.txt") == 1:
vk.method("messages.send", {"peer_id": id, "message": str("test"), "random_id": random.randint(1, 2147483647)})
else:
vk.method("messages.send", {"peer_id": id, "message": str(admno),
"random_id": random.randint(1, 2147483647)})
Answer the question
In order to leave comments, you need to log in
As a matter of fact:
I think that it is necessary, firstly, that the function returns the value of the desired variable. For example, using return
Second, there is a feeling that it would not hurt the function to accept some parameters, for example, all these secrets, id, etc. and pass them to the class to create the desired object and return it through return
Thirdly, I don’t see where balance is used in the code, but in fact you just need to call the function correctly and get the value it returns (apparently, an instance of the class).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question