def check_potion(uid, potion_type):
potions = {'user_faith_potion': user_faith_potion,
'user_mf_potion': user_mf_potion,
'user_damage_potion': user_damage_potion}
current_potion = potions.get(potion_type)
if current_potion:
potion = current_potion.objects.filter(user_potion_id = uid)
if potion:
for f in potion:
if f.potion_exp_time.timestamp() < datetime.datetime.now().timestamp():
potion.delete()
return False
str(pe[1])
for pe in result_Pyaterechka:
print('')
peremenna_user_id_Pyaterechka = peremenna_user_id_Pyaterechka + str(pe[1])
import requests
url = "https://api.inferkit.com/v1/models/standard/generate"
params = {
"prompt": {
"text": "Hello world!"
},
"length": 500
}
headers = {
'Authorization': 'Bearer fc793bbe-dbc5-47d7-8823-a8d06fb24f28',
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, json=params)
print(response.text)
Уже 2 день пытаюсь пофиксить
414 Request-URI Too Long
result=requests.post('https://api.vk.com/method/photos.saveWallPhoto', data={
'access_token':token,
'group_id':GROUP_ID,
'server':upload_response['server'],
'photo':upload_response['photo'],
'hash':upload_response['hash'],
'v':ver,}).json()