Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- yester = 10000000
- from threading import Thread
- import requests
- import vk_api
- import schedule
- import random
- import time
- from time import sleep
- import datetime
- import json
- import re
- api_access_token = 'киви, делал для теста, позже хочу добавить автодонат' # токен можно получить здесь https://qiwi.com/api
- my_login = '' # номер QIWI Кошелька в формате +79991112233
- from vk_api.keyboard import VkKeyboard, VkKeyboardColor
- from vk_api.utils import get_random_id
- vk_session = vk_api.VkApi(token = 'apitoken')
- a = 0
- from vk_api.longpoll import VkLongPoll, VkEventType
- longpoll = VkLongPoll(vk_session)
- vk = vk_session.get_api()
- last_pend = 0
- print(vk_api.__version__)
- session = requests.Session()
- login, password = 'login', 'password'
- vk_session1 = vk_api.VkApi(login, password)
- try:
- vk_session1.auth(token_only=True)
- except vk_api.AuthError as error_msg:
- print(error_msg)
- vk1 = vk_session1.get_api()
- idcurr = 1107
- daykomis = 0
- hel = ['Если бот не отвечает на сообщения, это может значить что он временно выключен либо производит рассылку и ответит на все сообщения немного позже, поэтому не стоит флудить', 'Если вы нашли баг, то гораздо лучше сообщить о нём в обсуждении https://vk.com/topic-187194307_44119500 и получить игровую валюту, чем получить наказание за багоюз','Основная беседа бота находится по ссылке - https://vk.me/join/AJQ1d9fX/hUEYTFwkq81PeWW', 'Полная статья с функционалом бота находится по ссылке - https://vk.cc/arYKYv','О всех багах можно сообщать в обсуждение группы - https://vk.com/topic-187194307_44119500', 'Каждый день в 12:00 в группе проходит автоконкурс за лайк', 'О любых идеях, связанных с ботом вы можете сообщать разработчику - @lionead. Хорошие идеи хорошо оплачиваются игровой валютой😉', 'Все средства с доната идут на развитие группы и конкурсы']
- def job():
- print("I'm working...")
- with open("konk.txt") as file:
- array = [row.strip() for row in file]
- def group(iterable, count):
- """ Группировка элементов последовательности по count элементов """
- return zip(*[iter(iterable)] * count)
- ar = array[0].split(' ')
- idcurr = int(ar[0])
- daykomis = int(ar[1])
- yester = int(ar[2])
- schedule.every(10).seconds.do(job)
- def grop(ar, N):
- subList = [ar[n:n+N] for n in range(0, len(ar), N)]
- return subList
- ###print(grop(hel, 4))
- def des(inputInt):
- int(float(str(inputInt)))
- try:
- if not inputInt == 0:
- return str('{0:,}'.format(int(inputInt)).replace(',',"."))
- else:
- return '0'
- except:
- pass
- vk.messages.send(user_id=294716376, attachment = 'photo-187194307_457239385', random_id=random.randint(1,999999))
- def konkurs():
- try:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- global idcurr, daykomis, yester
- all1 = vk1.likes.getList(type = 'post', owner_id = -187194307, item_id = idcurr, filter = 'likes', count = 1000)
- prize = int(yester/int(all1['count']))
- ####print(prize)
- winner = all1['items']
- ####print(winner)
- for elem in array:
- if int(elem.split(' ')[0]) in winner:
- ####print('FFF')
- try:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(prize))+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(prize))+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(prize))+' 1'
- try:
- vk.messages.send(user_id = elem.split(' ')[0], message = 'Спасибо за участие в конкурсе! Вы получили '+des(prize)+'$', random_id = time.time())
- except:
- pass
- except:
- pass
- ####print('FFFFFFFFFFFF')
- idcurr1 = vk1.wall.post(owner_id = -187194307, from_group = 1, message = 'Ежедневный конкурс! Разыгрывается '+des(daykomis)+'$ между каждым лайкнувшим, т.е. приз будет разделён между всеми людьми!\nИтоги через 24 часа, если у вас закрыто лс - вы не получите приз.', attachment = 'photo-187194307_457239385')
- idcurr = idcurr1['post_id']
- yester = daykomis
- daykomis = 0
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- except Exception as e:
- ####print(e)
- vk.messages.send(user_id=294716376, message = str(e), random_id=random.randint(1,999999))
- schedule.every().monday.at('09:00').do(konkurs)
- schedule.every().tuesday.at('09:00').do(konkurs)
- schedule.every().wednesday.at('09:00').do(konkurs)
- schedule.every().thursday.at('09:00').do(konkurs)
- schedule.every().friday.at('09:00').do(konkurs)
- schedule.every().saturday.at('09:00').do(konkurs)
- schedule.every().sunday.at('09:00').do(konkurs)
- vip = ['275164129','522095175','478474482','294716376','522858164','405098233', '297476508']
- def mone(inputStr):
- return (int(inputStr[1]))
- #def f():
- farms6 = {'RX590':[120000, 9000], 'GTX1660TI':[340000, 21000], 'RTX2080SUPER':[40000000, 1030000]}
- def f():
- global idcurr, daykomis, yester, hel, last_pend
- phr = ['🤖 Буп боп. Буп бип?', '🤖 Сложно! Я же просто бот.', '🤖 Моя твоя не понимать.', '🤖 Может когда-то я научусь понимать язык людей...', '🤖 Может уже скажешь мне команду?']
- stickers = [16788, 16935, 18670, 18650, 17629, 8018, 7677, 13897]
- while True:
- try:
- for event in longpoll.listen():
- uu = ''
- ####print('e')
- if event.to_me and event.type == VkEventType.MESSAGE_NEW and event.user_id == 581870894:
- vk.messages.send(user_id=294716376, forward_messages = event.message_id, random_id=random.randint(1,999999))
- if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
- if True:
- main_mess = ''
- if 'Бот]' in event.text:
- try:
- main_mess=event.text.casefold().split('бот] ',1)[1]
- except:
- pass
- elif '@' in event.text:
- try:
- main_mess=event.text.casefold().split(' ',1)[1]
- except:
- pass
- else:
- try:
- main_mess=event.text.casefold()
- except:
- pass
- random.seed(time.time())
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Меню', color=VkKeyboardColor.POSITIVE)
- if not event.user_id == last_pend:
- u = ''
- nick = ''
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- nick = vk.users.get(user_ids=event.user_id)[0]['first_name']
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- nick = elem.split(' ')[3]
- except:
- pass
- u = nick+', '
- isnew=False
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- isnew=True
- if isnew==False:
- with open("test.txt", "a") as file:
- file.write(str(event.user_id)+' '+str(1000) + ' 1\n')
- keyboard = VkKeyboard(one_time=False)
- with open("bonus.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- posi = False
- keyboard.add_button('VIP-Бонус', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- flag = True
- if int(int(elem.split(' ')[1])+86400)<=int(time.time()):
- keyboard.add_button('Бонус', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- posi = True
- if posi == False:
- keyboard.add_button('Бонус', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('💰Баланс', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('🎰Казино', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('🔐Сейф', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('🥛Стаканчик', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Комиссия', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Передать', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('🆔Узнать мой ID', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('🆔Узнать ID по ссылке', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('🔝Топ игроков', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('🔝Топ сейфов', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('⚙Настройки', color=VkKeyboardColor.PRIMARY)
- vk.messages.send (peer_id = event.peer_id,message = 'Welcome! +1.000$\n\n Приветствуем! Так как вы новый пользователь, вы будете автоматически получать рассылки. Чтобы отключить их, перейдите в меню, а затем в настройки. Желаем удачи!\nКроме того, рекомендуем ознакомиться с полезной статьей для новичков - https://vk.cc/arYKYv', random_id = random.randint(1, 99999999),keyboard=keyboard.get_keyboard(),attachment = 'photo-187194307_457239414')
- if main_mess== '💰баланс' or main_mess == 'баланс':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'ваш баланс - ' + des(elem.split(' ')[1])+"$",keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='🆔узнать мой id':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'🆔Ваш ID ВКонтакте - '+str(event.user_id),keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='комиссия':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'накоплено за сутки - '+str(des(daykomis))+'$\n\n❓Что такое комиссия? Она копится за счёт казино. Ровно в 12:00 по МСК каждый день проводится автоконкурс со средств комиссии в течение суток, где все лайкнувшие делят между собой приз👻\n✴У людей с VIP-статусом комиссия снижена в 2 раза.',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='стат':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- non_all = 0
- for elem in array:
- if elem.split(' ')[2] == '0':
- non_all = non_all + 1
- vk.messages.send(peer_id = event.peer_id, message = 'Количество всех диалогов - '+str(vk.messages.getConversations(offset = 0, count = 0, filter= "all")['count'])+'\nКоличество пользователей, написавших со старта бота - '+str(len(array))+'\nКол-во людей, запретивших рассылки (без учёта закрытого лс) - '+str(non_all)+'\nРазрешивших рассылки - '+str(len(array)-non_all),random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- #2000000000
- elif main_mess=='фермы':
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Ферма RX590', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Ферма GTX1660TI', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Ферма RTX2080SUPER', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id, message = 'Доступные для покупки фермы:\n1. RX590. Цена - 120.000$. Доход - 9.000$/час\n2. GTX1660TI. Цена - 340.000$. Доход - 21.000$/час\n2. RTX2080SUPER. Цена - 40.000.000$. Доход - 1.030.000$/час.\n Купить фермы можно с помощью команды ферма [Точное Название] [Количество]',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- elif main_mess=='ферма':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Продать фермы', color=VkKeyboardColor.POSITIVE)
- flag = True
- farm = elem.split(' ')[1]
- dohod = farms6[farm][1]
- cnt = int(elem.split(' ')[2])
- #datetime.timedelta(seconds = delta)
- nakop = int((int(time.time())-int(elem.split(' ')[3]))/3600*dohod*cnt)
- if 3600 - (int(time.time())-int(elem.split(' ')[3]))>=0:
- vk.messages.send(peer_id = event.peer_id, message = 'Накоплено на ферме - '+str(des(nakop))+'$. Ваша ферма - '+farm+'[x'+str(cnt)+']\nДо вывода осталось '+str(datetime.timedelta(seconds = 3600 - (int(time.time())-int(elem.split(' ')[3]))))+'.',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- else:
- keyboard.add_line()
- keyboard.add_button('Снять деньги', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id, message = 'Накоплено на ферме - '+str(des(nakop))+'$. Ваша ферма - '+farm+'[x'+str(cnt)+']\nМожно совершить вывод!',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- #if not flag:
- #keyboard = VkKeyboard(inline = True)
- # keyboard.add_button('Фермы', color=VkKeyboardColor.POSITIVE)
- # vk.messages.send(peer_id = event.peer_id, message = 'Биткоин фермы позволяют зарабатывать деньги пассивно! Попробуй:',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- elif 'снять деньги' in main_mess:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- for elem1 in array:
- if elem1.split(' ')[0] == str(event.user_id):
- if int(time.time())-int(elem.split(' ')[3])>=3600:
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- flag = True
- farm = elem.split(' ')[1]
- dohod = farms6[farm][1]
- cnt = int(elem.split(' ')[2])
- #datetime.timedelta(seconds = delta)
- nakop = int((int(time.time())-int(elem.split(' ')[3]))/3600*dohod*cnt)
- cena = nakop
- try:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(cena))+' '+elem1.split(' ')[2]+' '+elem1.split(' ')[3]
- except:
- try:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(cena))+' '+elem1.split(' ')[2]
- except:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(cena))+' 1'
- array1[array1.index(elem)] = elem.split(' ')[0] + ' '+elem.split(' ')[1]+' '+elem.split(' ')[2]+' '+str(int(time.time()))
- vk.messages.send (peer_id = event.peer_id,message = 'Вы сняли '+str(des(nakop))+'$ с фермы '+elem.split(' ')[1]+'[x'+elem.split(' ')[2]+']', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- else:
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- delta = 3600-(int(time.time())-int(elem.split(' ')[3]))
- vk.messages.send (peer_id = event.peer_id,message = 'Подождите ещё '+str(datetime.timedelta(seconds = delta))+' до следющего снятия денег с фермы!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("farms.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- elif main_mess=='продать фермы':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- cena = int(int(farms6[elem1.split(' ')[1]][0])*int(elem1.split(' ')[2])/3*2)
- del array1[array1.index(elem1)]
- for elem in array:
- if elem.split(' ')[0] == str(event.user_id):
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(cena))+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(cena))+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(cena))+' 1'
- vk.messages.send(peer_id = event.peer_id,message = 'Вы успешно продали фермы за '+str(cena)+'$', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("farms.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- elif 'ферма' in main_mess:
- if 0>1:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- flag = False
- try:
- if event.text.split(' ')[1] in farms6:
- for elem in array:
- if elem.split(' ')[0] == str(event.user_id):
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- flag = True
- if not elem1.split(' ')[1] == event.text.split(' ')[1]:
- vk.messages.send (peer_id = event.peer_id,message = 'У вас уже имеется ферма - '+elem1.split(' ')[1]+'[x'+elem1.split(' ')[2]+']\nВы можете докупить ещё или продать их с командой "Продать фермы"', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if not flag:
- if farms6[event.text.split(' ')[1]][0]*int(main_mess.split(' ')[2])<=int(elem.split(' ')[1]):
- cena = farms6[event.text.split(' ')[1]][0]*int(main_mess.split(' ')[2])
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(cena))+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(cena))+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(cena))+' 1'
- try:
- if main_mess.split(' ')[2].isdigit():
- cnt = int(main_mess.split(' ')[2])
- else:
- cnt = 1
- except:
- cnt = 1
- array1.append(str(event.user_id)+' '+event.text.split(' ')[1]+' '+str(cnt)+' '+str(int(time.time())))
- vk.messages.send (peer_id = event.peer_id,message = 'Вы приобрели ферму '+event.text.split(' ')[1]+'[x'+str(cnt)+']', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- else:
- vk.messages.send (peer_id = event.peer_id,message = 'Недостаточно средств для покупки!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if flag:
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- if event.text.split(' ')[1] == elem1.split(' ')[1]:
- if farms6[event.text.split(' ')[1]][0]<=int(elem.split(' ')[1]):
- cena = farms6[event.text.split(' ')[1]][0]
- ar9 = 0
- try:
- if main_mess.split(' ')[2].isdigit():
- cnt = int(elem1.split(' ')[2])+int(main_mess.split(' ')[2])
- ar9=main_mess.split(' ')[2]
- else:
- ar9 = 1
- cnt = int(elem1.split(' ')[2])+1
- except:
- ar9=1
- cnt = int(elem1.split(' ')[2])+1
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(cena))+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(cena))+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(cena))+' 1'
- array1[array1.index(elem1)] = str(str(event.user_id)+' '+event.text.split(' ')[1]+' '+str(cnt)+' '+str(int(time.time())))
- vk.messages.send (peer_id = event.peer_id,message = 'Вы приобрели ферму '+event.text.split(' ')[1]+'[x'+str(ar9)+']', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- else:
- vk.messages.send (peer_id = event.peer_id,message = 'Недостаточно средств для покупки!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("farms.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- except:
- pass
- elif 'передать' in main_mess and main_mess.split(' ')[0]=='передать':
- exc = False
- try:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Меню', color=VkKeyboardColor.POSITIVE)
- to_id = main_mess.split(' ')[1]
- if to_id.isdigit():
- pass
- elif '@' in to_id:
- ####print(to_id.split('@'))
- e = vk.users.get(user_ids = to_id.split('@')[1].split(']')[0])
- ####print(e)
- ####print(to_id.split('@')[1].split(']'))
- to_id = str(e[0]['id'])
- ####print(to_id)
- else:
- try:
- e1 = to_id.split('com/')[1]
- e = vk.users.get(user_ids = e1)
- to_id = str(e[0]['id'])
- except:
- vk.messages.send (peer_id = event.peer_id,message = 'Введите корректную ссылку!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- exc = True
- ####print(to_id)
- sum=''
- try:
- sum1 = main_mess.split(' ')[2]
- except:
- pass
- try:
- if 'к' in sum1:
- cnt = sum1.count('к')
- sum = str(int(re.findall ('(\d+)', sum1)[0])* 1000**cnt)
- else:
- sum = str(main_mess.split(' ')[2])
- #print(sum)
- except:
- if 'к' in sum1:
- cnt = sum1.count ('к')
- sum = str(1000**cnt)
- else:
- sum = main_mess.split(' ')[2]
- if event.user_id == int(to_id):
- vk.messages.send (peer_id = event.peer_id,message = 'Нельзя передать деньги самому себе.', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard(),attachment = 'photo-187194307_457239442')
- exc = True
- flag = False
- if sum.isdigit():
- if int(sum)>0:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if int(elem.split(' ')[1])>=int(sum):
- for elem1 in array:
- if elem1.split(' ')[0]==to_id:
- flag = True
- try:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(sum))+' '+elem1.split(' ')[2]+' '+elem1.split(' ')[3]
- except:
- try:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(sum))+' '+elem1.split(' ')[2]
- except:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(sum))+' 1'
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(sum))+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(sum))+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])-int(sum))+' 1'
- try:
- if elem1.split(' ')[4] == '1':
- vk.messages.send (user_id = int(to_id),message = '[id'+str(event.user_id)+'|Пользователь] передал вам '+des(sum)+'$!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- except:
- vk.messages.send (user_id = int(to_id),message = '[id'+str(event.user_id)+'|Пользователь] передал вам '+des(sum)+'$!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- vk.messages.send (peer_id = event.peer_id,message = 'Успешно. Передано '+des(sum)+'$ [id'+to_id+'|игроку].', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- else:
- vk.messages.send (peer_id = event.peer_id,message = 'Недостаточно средств. Ваш баланс - '+elem.split(' ')[1]+'$.', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- exc = True
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- if flag == False:
- if not exc:
- vk.messages.send (peer_id = event.peer_id,message = 'Данный пользователь не найден.', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- exc = True
- else:
- if not exc:
- vk.messages.send (peer_id = event.peer_id,message = 'Минимальная сумма - 1$.', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- exc = True
- else:
- if not exc:
- vk.messages.send (peer_id = event.peer_id,message = 'Введите корректную сумму!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- exc = True
- except:
- if not exc:
- vk.messages.send (peer_id = event.peer_id,message = 'Использование команды - Передать [id пользователя ИЛИ ссылка] [сумма]. Пример - Передать vk.com/lionead 600.', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- elif 'id' in main_mess:
- try:
- scr = str(main_mess.split(' ')[1])
- if not '/' in scr:
- e = vk.users.get(user_ids = scr)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'ID Пользователя - ' + str(e[0]['id']),keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- else:
- e1 = scr.split('com/')[1]
- e = vk.users.get(user_ids = e1)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'ID Пользователя - ' + str(e[0]['id']),keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- except:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'использование команды: ID [Ссылка]',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess.split(' ')[0]=='никнейм' or main_mess.split(' ')[0]=='ник':
- new = ''
- try:
- text = event.text.split('] ')[1]
- except:
- text = event.text
- try:
- new = text.split(' ')[1]
- except:
- pass
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- if len(new)<16:
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if new == '':
- nick = ''
- try:
- nick = elem.split(' ')[3]
- vk.messages.send (peer_id = event.peer_id,message = 'Ваш текущий никнейм - '+nick+'.\nСменить никнейм можно командой "Никнейм [Новый никнейм без пробелов]"',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- except:
- vk.messages.send (peer_id = event.peer_id,message = u+'установи свой никнейм с помощью команды! Пример - "Никнейм Василий"',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- if not new == '':
- try:
- array[array.index(elem)]=elem.split(' ')[0] + ' '+elem.split(' ')[1]+' '+elem.split(' ')[2]+' '+new
- except:
- array[array.index(elem)]=elem.split(' ')[0] + ' '+elem.split(' ')[1]+' 1 '+new
- vk.messages.send (peer_id = event.peer_id,message = 'Никнейм установлен.',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- else:
- vk.messages.send (peer_id = event.peer_id,message = 'Максимальная длина никнейма - 16 символов!',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- last_pend = -1
- elif 'стаканчик' in main_mess:
- try:
- sum=''
- try:
- sum1 = main_mess.split(' ')[1]
- except:
- pass
- try:
- if 'к' in sum1:
- cnt = sum1.count ('к')
- sum = str(int(re.findall ('(\d+)', sum1)[0])* 1000**cnt)
- else:
- sum = str(main_mess.split(' ')[1])
- #print(sum)
- except:
- if 'к' in sum1:
- cnt = sum1.count ('к')
- sum = str(1000**cnt)
- else:
- sum = main_mess.split(' ')[1]
- usnum = main_mess.split(' ')[2]
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if int(elem.split(' ')[1])>=int(sum):
- if int(sum)>0:
- randnum = random.randint(1,3)
- if randnum == int(usnum):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])+int(sum)*2) +' '+elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])+int(sum)*2) +' 1'+' '+uu
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])+int(sum)*2))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id, message = u+'поздравляем, вы угадали! +'+des(int(sum)*2)+'$😊\n\nВаш баланс - '+des(int(int(elem.split(' ')[1])+int(sum)*2))+'$', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999),attachment = 'photo-187194307_457239419')
- sleep(0.03)
- elif not randnum == int(usnum):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])-int(sum)) +' '+elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])-int(sum)) +' 1'+' '+uu
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])-int(sum)))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id, message = u+'не повезло. -'+des(sum)+'$😔\n\nВаш баланс - '+des(int(int(elem.split(' ')[1])-int(sum)))+'$', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999),attachment = 'photo-187194307_457239413')
- sleep(0.03)
- else:
- keyboard = VkKeyboard(inline=True)
- if not int(elem.split(' ')[1]) == 0:
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id, message = u+"минимальная ставка - 1$!", random_id = random.randint(1,999999), keyboard = keyboard.get_keyboard())
- else:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- if not int(elem.split(' ')[1]) == 0:
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id, message = u+"на балансе недостаточно средств!", random_id = random.randint(1,999999), keyboard = keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- except:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- keyboard = VkKeyboard(inline=True)
- if not int(elem.split(' ')[1]) == 0:
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- else:
- keyboard.add_button('📛Недостаточно средств📛', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id, message = u+'использование команды - стаканчик [сумма] [номер стаканчика]\n Пример: "Стаканчик 5000 2" \n\n Угадай номер стаканчика с шариком и утрой свои деньги🥛💵\n Примечание: если у вас на балансе недостаточно средств, поставить не получится. Минимальная ставка - 1$', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999), attachment = 'photo-187194307_457239418')
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- sticker_id = 735
- )
- elif main_mess=='🔝топ сейфов':
- with open("safes.txt") as file:
- array = [row.strip() for row in file]
- new = []
- for elem in array:
- try:
- new.append(elem.split(' '))
- except:
- pass
- ####print(int)
- new.sort(key = mone, reverse = True)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- a = ""
- ####print(vk.users.get(user_ids='2,3,4'))
- all_usr= "0"
- for i in range(10):
- all_usr = all_usr +','+ str(new[i][0])
- ####print(all_usr)
- bal = vk.users.get(user_ids=all_usr)
- try:
- for i in range(10):
- add = ''
- if str(new[i][0]) in vip:
- add = '༺VIP༻'
- if str(new[i][0]) == str('294716376'):
- add = '༺Ă ͏̷̬̝̲̳̲͑͆͆̀̃̍Ď ̵̷̡̡̛̥̠͙̤̥͓̥͇̟͇̯̜̭̝̝̗͉̫̱̝͌̅̋͂̀̌̉̌̑̉̇͒̃͑͌̍̉̀̒̚͜͜͡ͅМ ̧͓̝͈͛̆͢͡͝Ĩ ̷̨̮̫̲͇̩̥̂̄͒͂̒͌̈̈͒̃̈́̑̿̉̕͝͠͞Ń ̵̨̘̝̤̯̣̂́̀̒̾͛͒̒̏̓̕͘͝ͅͅ༻'
- try:
- a = a + str((str(i+1)+'. '+add+'[id'+str(new[i][0])+'|'+bal[i]['first_name']+' '+bal[i]['last_name']+'] - ' + des(new[i][1]) +'🔓\n'))
- except:
- pass
- except:
- pass
- vk.messages.send (peer_id = event.peer_id,message = u+'топ взломщиков сейфов:\n'+a,keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif '🔐сейф' in main_mess or 'сейф' in main_mess:
- try:
- usnum = main_mess.split(' ')[1]
- if int(usnum)>0 and int(usnum)<101:
- truenum = random.randint(1,100)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Сейф ' + str(random.randint(1,100)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- if truenum == int(usnum):
- sum = random.randint(0,200000)
- vk.messages.send (peer_id = event.peer_id, message = u+'нииичоси! Повезло так повезло😱 Вы получаете '+des(sum)+'$!' , random_id = random.randint(1,999999), attachment = 'photo-187194307_457239416')
- vk.messages.send (peer_id = event.peer_id, sticker_id = 7377,keyboard=keyboard.get_keyboard(), random_id = random.randint(1,999999))
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("safes.txt") as file:
- array1 = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1]) + sum) + ' ' + elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1]) + sum) + ' 1'
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- array1[array1.index(elem)] = elem.split(' ')[0] + ' '+ str(int(elem.split(' ')[1])+1)
- flag = True
- if not flag:
- array1.append(str(event.user_id)+ ' 1')
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("safes.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- else:
- vk.messages.send (peer_id = event.peer_id, message = u+'не повезло!😫 Попробуй ещё раз! Код сейфа - '+str(truenum), keyboard=keyboard.get_keyboard(), random_id = random.randint(1,999999))
- else:
- e = 1/0
- except:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Сейф ' + str(random.randint(1,100)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id, message = u+'использование команды - сейф [Число от 1 до 100]\n Пример: "сейф 54"\n\n Попробуй подобрать пароль для сейфа и получи до 200.000$!🤑', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999))
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- sticker_id = 733
- )
- elif main_mess=='выключить рассылки':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- array[array.index(elem)] = elem.split(' ')[0] +' '+ elem.split(' ')[1] + ' 0'+' '+uu
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Включить рассылки', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'успешно. Если надумаете снова включить рассылки, то можете сделать это в любое время через настройки😄',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='включить рассылки':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- array[array.index(elem)] = elem.split(' ')[0] +' '+ elem.split(' ')[1] + ' 1'+' '+uu
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Выключить рассылки', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'успешно. Спасибо!💙',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif main_mess=='рассылки':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- ####print(elem.split(' ')[2])
- status = elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem + ' 1'
- status = '1'
- if status == '1':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Выключить рассылки', color=VkKeyboardColor.NEGATIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'текущий статус рассылок - ВКЛ',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- if status == '0':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Включить рассылки', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'текущий статус рассылок - ВЫКЛ',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif main_mess=='⚙настройки':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Рассылки', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Никнейм', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u+'выберите нужную категорию настроек.',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999),attachment = 'photo-187194307_457239415')
- elif main_mess=='🔝топ игроков':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- new = []
- for elem in array:
- try:
- new.append(elem.split(' '))
- except:
- pass
- ####print(int)
- new.sort(key = mone, reverse = True)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- a = ""
- all_usr= "0"
- for i in range(10):
- all_usr = all_usr +','+ str(new[i][0])
- ####print(all_usr)
- bal = vk.users.get(user_ids=all_usr)
- for i in range(10):
- add = ''
- if str(new[i][0]) in vip:
- add = '༺VIP༻'
- if str(new[i][0]) == str('294716376'):
- add = '༺Ă ͏̷̬̝̲̳̲͑͆͆̀̃̍Ď ̵̷̡̡̛̥̠͙̤̥͓̥͇̟͇̯̜̭̝̝̗͉̫̱̝͌̅̋͂̀̌̉̌̑̉̇͒̃͑͌̍̉̀̒̚͜͜͡ͅМ ̧͓̝͈͛̆͢͡͝Ĩ ̷̨̮̫̲͇̩̥̂̄͒͂̒͌̈̈͒̃̈́̑̿̉̕͝͠͞Ń ̵̨̘̝̤̯̣̂́̀̒̾͛͒̒̏̓̕͘͝ͅͅ༻'
- try:
- a = a + str((str(i+1)+'. '+add+'[id'+str(new[i][0])+'|'+bal[i]['first_name']+' '+bal[i]['last_name']+'] - ' + des(new[i][1]) +'$\n'))
- except:
- pass
- vk.messages.send (peer_id = event.peer_id,message = u+'топ игроков бота:\n'+a,keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='казино все' or main_mess=='казино всё':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if int(elem.split(' ')[1])>0:
- kef=random.randint(0,8)*0.25
- wow = False
- if kef==2 and random.randint(0,9)==0:
- kef = 4
- wow = True
- if kef==2 and random.randint(0,20)==0:
- kef = 10
- wow = True
- if kef == 2 and random.randint(0,30)==0:
- kef = 30
- wow = True
- comis = 0.01
- if str(elem.split(' ')[0]) in vip:
- comis = 0.005
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- newbalance = str(int(int(elem.split(' ')[1])*kef*(1-comis)))
- if not event.user_id == 503708185:
- daykomis = daykomis + int(int(elem.split(' ')[1])*kef*(comis))
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' 1'
- att =''
- if kef==1:
- mess="Ваши деньги остаются при вас.["
- att = 'photo-187194307_457239413'
- elif kef>1:
- mess="Поздравляем! Вы выиграли с коэффициентом ["
- att = 'photo-187194307_457239419'
- elif kef<1:
- mess="Увы, вы проиграли с коэффициентом ["
- att = 'photo-187194307_457239413'
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- if kef>0:
- keyboard.add_line()
- keyboard.add_button('Казино 100%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 50%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 25%', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u + mess+"x"+str(kef)+"]\n"+'Ваш баланс - ' + des(newbalance)+"$\nКомиссия - "+str(float(comis)*100)+'%', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard(),attachment = att)
- if wow == True:
- vk.messages.send (peer_id = event.peer_id, sticker_id = 726, random_id = time.time())
- stik = [14256,12689]
- if kef == 0:
- vk.messages.send (peer_id = event.peer_id,sticker_id = stik[random.randint(0,1)], random_id = random.randint(1, 999999))
- else:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = "Минимальная ставка - 1$!", random_id = random.randint(1, 999999), keyboard = keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif main_mess=='vip-бонус':
- keyboard = VkKeyboard(inline=True)
- if str(event.user_id) in vip:
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("vip.txt") as file:
- array1 = [row.strip() for row in file]
- ####print(array)
- flag = False
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- flag = True
- delta = int(elem1.split(' ')[1])+10800-int(time.time())
- if int(int(elem1.split(' ')[1])+10800)<=int(time.time()):
- sum = random.randint(0,1000000)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- vk.messages.send (peer_id = event.peer_id,message =u+"вы получаете "+str(des(sum))+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1[array1.index(elem1)] = str(event.user_id)+' '+str(int(time.time()))
- else:
- vk.messages.send (peer_id = event.peer_id,message ="Подождите ещё "+str(datetime.timedelta(seconds = delta)) +' до получения следующего бонуса.', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if flag == False:
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- sum = random.randint(0,1000000)
- ####print(sum)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- #try:
- #array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- #except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- ####print(sum)
- vk.messages.send (peer_id = event.peer_id,message =u+"вы получаете "+str(des(sum))+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1.append(str(event.user_id)+' '+str(int(time.time())))
- ####print(str(event.user_id)+' '+str(int(time.time())))
- with open("test.txt", "w") as file:
- for line in array:
- ####print(str(line))
- file.write(str(line)+"\n")
- with open("vip.txt", "w") as file:
- for line in array1:
- ####print(str(line))
- file.write(str(line)+"\n")
- else:
- keyboard.add_openlink_button('Оплата', 'https://qiwi.com/n/lionead')
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id,message ="Данная команда доступна только VIP-Пользователям. При оплате обязательно указывайте ссылку на профиль.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard(),attachment = 'market-187194307_3267052')
- elif main_mess=='бонус':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("bonus.txt") as file:
- array1 = [row.strip() for row in file]
- ####print(array)
- flag = False
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- flag = True
- delta = int(elem1.split(' ')[1])+86400-int(time.time())
- text = str(datetime.timedelta(seconds = delta))
- if int(int(elem1.split(' ')[1])+86400)<=int(time.time()):
- sum = random.randint(10000,100000)
- ####print(sum)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- ####print(sum)
- vk.messages.send (peer_id = event.peer_id,message =u+"вы получаете "+str(des(sum))+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1[array1.index(elem1)] = str(event.user_id)+' '+str(int(time.time()))
- else:
- vk.messages.send (peer_id = event.peer_id,message ="Подождите ещё " + text + ' до получения следующего бонуса!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if flag == False:
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- sum = random.randint(10000,100000)
- ####print(sum)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- #try:
- #array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- #except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- ####print(sum)
- vk.messages.send (peer_id = event.peer_id,message =u+"вы получаете "+str(des(sum))+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1.append(str(event.user_id)+' '+str(int(time.time())))
- ####print(str(event.user_id)+' '+str(int(time.time())))
- with open("test.txt", "w") as file:
- for line in array:
- ####print(str(line))
- file.write(str(line)+"\n")
- with open("bonus.txt", "w") as file:
- for line in array1:
- ####print(str(line))
- file.write(str(line)+"\n")
- #vk.messages.send(peer_id = event.peer_id,message = 'Welcome to the menu! \n T E S T', random_id = random.randint(1, 999999))
- elif main_mess=='🎰казино':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- keyboard = VkKeyboard(inline=True)
- if not int(elem.split(' ')[1]) == 0:
- keyboard.add_button('Казино 100%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 50%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 25%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- else:
- keyboard.add_button('📛Недостаточно средств📛', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id,keyboard=keyboard.get_keyboard(),message = 'Использование команды:\nКазино [Сумма]/[Количество процентов от баланса]/Всё', random_id = random.randint(1, 999999),attachment = 'photo-187194307_457239412')
- elif 'казино' in main_mess:
- sum=0
- sum1 = ''
- pro = 0
- balance = 0
- k = 1
- exc = False
- try:
- sum1 = main_mess.split(' ')[1]
- #print(sum1)
- except:
- pass
- try:
- if 'к' in sum1:
- #print('found k')
- cnt = sum1.count ('к')
- sum = int(int(re.findall ('(\d+)', sum1)[0])* 1000**cnt)
- #print(sum)
- elif '%' in sum1:
- #print('found k')
- pro = int(re.findall ('(\d+)', sum1)[0])
- print(pro)
- if pro>0 and pro<101:
- k = float(pro/100)
- print(k)
- else:
- exc = True
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message ="Количество процентов от баланса должно быть более 0 и не больше 100.",keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- #print(sum)
- else:
- sum = int(main_mess.split(' ')[1])
- ##print(sum)
- except:
- #print('excepted')
- if 'к' in sum1:
- cnt = sum1.count ('к')
- sum = 1000**cnt
- #print(sum)
- else:
- sum = int(main_mess.split(' ')[1])
- #print(sum)
- if sum>0 or pro>0:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- balance = int(elem.split(' ')[1])
- if pro>0:
- sum = int(balance*k)
- if sum>0:
- ####print(balance)
- kef=random.randint(0,8)*0.25
- wow = False
- if kef == 2 and random.randint(0,9)==0:
- kef = 4
- wow = True
- if kef == 2 and random.randint(0,20)==0:
- kef = 10
- wow = True
- if kef == 2 and random.randint(0,30)==0:
- kef = 30
- wow = True
- if str(elem.split(' ')[0]) in vip:
- comis = 0.005
- else:
- comis = 0.01
- newbalance = str(int(int(int(elem.split(' ')[1])-sum+(sum*kef*(1-comis)))))
- if sum<=balance:
- if not event.user_id == 503708185:
- daykomis = daykomis + int(int(sum)*kef*(comis))
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' 1'
- att = ''
- if kef==1:
- att = 'photo-187194307_457239413'
- mess="ваши деньги остаются при вас. ["
- elif kef>1:
- mess="поздравляем! Вы выиграли с коэффициентом ["
- att = 'photo-187194307_457239419'
- elif kef<1:
- mess="увы, вы проиграли с коэффициентом ["
- att = 'photo-187194307_457239413'
- keyboard = VkKeyboard(inline=True)
- if pro == 100 and kef == 0:
- print('F')
- else:
- keyboard.add_button('Казино 100%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 50%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 25%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message = u + mess+"x"+str(kef)+"]\n"+'Ваш баланс - ' + des(newbalance)+"$\nКомиссия - "+str(float(comis)*100)+'%', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard(),attachment = att)
- if wow == True:
- vk.messages.send (peer_id = event.peer_id, sticker_id = 726, random_id = time.time())
- sleep(0.03)
- if pro == 100 and kef == 0:
- stik = [14256,12689]
- vk.messages.send (peer_id = event.peer_id,sticker_id = stik[random.randint(0,1)], random_id = random.randint(1, 999999))
- else:
- if not exc:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (peer_id = event.peer_id,message ="На вашем балансе нет столько денег! Ваш баланс - "+des(int(balance))+"$",keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- ####print(str(line))
- file.write(str(line)+"\n")
- else:
- if not exc:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id,keyboard=keyboard.get_keyboard(),message = 'Минимальная ставка - 1$!', random_id = random.randint(1, 999999))
- else:
- if not exc:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(peer_id = event.peer_id,keyboard=keyboard.get_keyboard(),message = 'Минимальная ставка - 1$!', random_id = random.randint(1, 999999))
- elif main_mess=='стат':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- non_all = 0
- for elem in array:
- if elem.split(' ')[2] == '0':
- non_all = non_all + 1
- vk.messages.send(peer_id = event.peer_id, message = 'Количество всех диалогов - '+str(vk.messages.getConversations(offset = 0, count = 0, filter= "all")['count'])+'\nКоличество пользователей, написавших со старта бота - '+str(len(array))+'\nКол-во людей, запретивших рассылки (без учёта закрытого лс) - '+str(non_all)+'\nРазрешивших рассылки - '+str(len(array)-non_all),random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- elif main_mess=='меню' or main_mess=='обратно в меню':
- keyboard = VkKeyboard(one_time=False)
- with open("bonus.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- posi = False
- keyboard.add_button('VIP-Бонус', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- flag = True
- if int(int(elem.split(' ')[1])+86400)<=int(time.time()):
- keyboard.add_button('Бонус', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- posi = True
- if posi == False:
- keyboard.add_button('Бонус', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('💰Баланс', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('🎰Казино', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('🔐Сейф', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('🥛Стаканчик', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Комиссия', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Передать', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('🆔Узнать мой ID', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('🆔Узнать ID по ссылке', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('🔝Топ игроков', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('🔝Топ сейфов', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('⚙Настройки', color=VkKeyboardColor.PRIMARY)
- keyboard.add_line()
- keyboard.add_openlink_button('Группа', 'https://vk.com/zeo_bot?from=quick_search')
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- keyboard=keyboard.get_keyboard(),
- message=u+'добро пожаловать в меню!',
- attachment = 'photo-187194307_457239414'
- )
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- sticker_id = 9880
- )
- else:
- if isnew and event.from_user:
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- message = phr[random.randint(0,len(phr)-1)], keyboard=keyboard.get_keyboard()
- )
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- sticker_id = stickers[random.randint(0,len(stickers)-1)]
- )
- if str(event.user_id)==str(294716376):
- ####print(event.attachments)
- mas = event.text.split(' ',1)
- if mas[0]=='рассылка':
- add = ''
- try:
- arr = event.attachments
- except:
- pass
- if not len(arr)==0:
- for i in range(int(int(len(arr))/2)):
- i = i + 1
- add = add + arr['attach'+str(i)+'_type'] + arr['attach'+str(i)] + ','
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- users = grop(array, 99)
- ids = ''
- count = 0
- for array in users:
- for elem in array:
- try:
- if elem.split(' ')[2] == '1':
- #if vk.messages.isMessagesFromGroupAllowed(group_id = 179758270, user_id = elem.split(' ')[0]):
- ids =ids + ',' + elem.split(' ')[0]
- except Exception as e:
- vk.messages.send(user_id=294716376, message = str(e), random_id=random.randint(1,999999))
- pass
- #vk.messages.send(user_id=294716376, message = str(array), random_id=random.randint(1,999999))
- try:
- count += len(ids.split(','))
- vk.messages.send (user_ids = ids,message = str(mas[1]),attachment = add, random_id = random.randint(1, 999999))
- except Exception as e:
- vk.messages.send(user_id=294716376, message = str(e), random_id=random.randint(1,999999))
- ids = ''
- vk.messages.send(user_id=294716376, message = 'Выполнена рассылка на '+str(count)+' человек', random_id=random.randint(1,999999))
- elif mas[0] == 'стикер':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- users = grop(array, 99)
- ids = ''
- for array in users:
- for elem in array:
- try:
- if elem.split(' ')[2] == '1':
- #if vk.messages.isMessagesFromGroupAllowed(group_id = 179758270, user_id = elem.split(' ')[0]):
- ids =ids + ',' + elem.split(' ')[0]
- except:
- pass
- try:
- vk.messages.send(user_ids = ids, sticker_id = mas[1], random_id = random.randint(1,999999))
- except Exception as e:
- vk.messages.send(user_id=294716376, message = str(e), random_id=random.randint(1,999999))
- ids = ''
- elif mas[0] == 'евал':
- keyboard = VkKeyboard(one_time=True)
- try:
- eval(mas[1])
- except Exception as e:
- vk.messages.send(user_id=294716376, message = str(e), random_id=random.randint(1,999999))
- vk.messages.send(user_id=294716376, message = 'Sucess.', random_id=random.randint(1,999999), keyboard=keyboard.get_keyboard())
- elif mas[0]=='выдать':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==mas[1].split(' ')[0]:
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)]=str(elem.split(' ')[0])+' '+str(int(elem.split(' ')[1])+int(mas[1].split(' ')[1]))+' '+elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)]=str(elem.split(' ')[0])+' '+str(int(elem.split(' ')[1])+int(mas[1].split(' ')[1]))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- id = mas[1].split(' ')[0]
- try:
- vk.messages.send(user_id=id, message = 'Администратор начислил на ваш баланс ' + des(mas[1].split(' ')[1])+'$!', random_id=random.randint(1,999999))
- except:
- pass
- vk.messages.send(user_id=294716376, message = 'Успешно. Начислено ' + des(mas[1].split(' ')[1])+'$ [id'+str(id)+'|игроку].', random_id=random.randint(1,999999))
- elif mas[0]=='вайп25876354783':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' 0 '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' 0 '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' 0 1'
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("safes.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- array[array.index(elem)] = elem.split(' ')[0] +' 0'
- with open("safes.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open('farms.txt', "w") as file:
- file.write("\n")
- with open('konk.txt', "w") as file:
- file.write("1000 0 0")
- with open("vip.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- array[array.index(elem)] = elem.split(' ')[0] +' 0'
- with open("vip.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("bonus.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- array[array.index(elem)] = elem.split(' ')[0] +' 0'
- with open("bonus.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- if mas[0]=='ктоя':
- sum = random.randint(100000,20000000000)
- vk.messages.send (peer_id = event.peer_id, message = u+'нииичоси! Повезло так повезло😱 Вы получаете '+des(sum)+'$!' , random_id = random.randint(1,999999))
- vk.messages.send (peer_id = event.peer_id, sticker_id = 7377,keyboard=keyboard.get_keyboard(), random_id = random.randint(1,999999))
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("safes.txt") as file:
- array1 = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1]) + sum) + ' ' + elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1]) + sum) + ' 1'
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- array1[array1.index(elem)] = elem.split(' ')[0] + ' '+ str(int(elem.split(' ')[1])+1)
- flag = True
- if not flag:
- array1.append(str(event.user_id)+ ' 1')
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("safes.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- if event.from_chat:
- if False:
- nul = False
- u = ''
- nick = ''
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- nick = vk.users.get(user_ids=event.user_id)[0]['first_name']
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- nick = elem.split(' ')[3]
- except:
- pass
- ####print(event.text)
- u = nick+', '
- main_mess = ''
- if 'Бот]' in event.text:
- try:
- main_mess=event.text.casefold().split('бот] ',1)[1]
- except:
- pass
- elif '@' in event.text:
- try:
- main_mess=event.text.casefold().split(' ',1)[1]
- except:
- pass
- else:
- try:
- main_mess=event.text.casefold()
- except:
- pass
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Меню', color=VkKeyboardColor.POSITIVE)
- isnew=False
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- isnew=True
- if isnew==False:
- with open("test.txt", "a") as file:
- file.write(str(event.user_id)+' '+str(1000) + ' 1\n')
- vk.messages.send (chat_id = event.chat_id,message = 'Welcome! +1.000$\n\n Приветствуем! Так как вы новый пользователь, вы будете автоматически получать рассылки. Чтобы отключить их, перейдите в меню, а затем в настройки. Желаем удачи!', random_id = random.randint(1, 999999))
- if main_mess== '💰баланс' or main_mess == 'баланс':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'ваш баланс - ' + des(elem.split(' ')[1])+"$",keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='комиссия':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'накоплено за сутки - '+str(des(daykomis))+'$\n\n❓Что такое комиссия? Она копится за счёт казино. Ровно в 12:00 по МСК каждый день проводится автоконкурс со средств комиссии в течение суток, где все лайкнувшие делят между собой приз👻\n✴У людей с VIP-статусом комиссия снижена в 2 раза.',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='фермы':
- if 0>1:
- #keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Ферма RX590', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Ферма GTX1660TI', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Ферма RTX2080SUPER', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(chat_id = event.chat_id, message = 'Доступные для покупки фермы:\n1. RX590. Цена - 120.000$. Доход - 9.000$/час\n2. GTX1660TI. Цена - 340.000$. Доход - 21.000$/час\n2. RTX2080SUPER. Цена - 40.000.000$. Доход - 1.030.000$/час.\n Купить фермы можно с помощью команды ферма [Точное Название] [Количество]',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- elif main_mess=='ферма':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Продать фермы', color=VkKeyboardColor.POSITIVE)
- flag = True
- farm = elem.split(' ')[1]
- dohod = farms6[farm][1]
- cnt = int(elem.split(' ')[2])
- #datetime.timedelta(seconds = delta)
- nakop = int((int(time.time())-int(elem.split(' ')[3]))/3600*dohod*cnt)
- if 3600 - (int(time.time())-int(elem.split(' ')[3]))>=0:
- vk.messages.send(chat_id = event.chat_id, message = 'Накоплено на ферме - '+str(des(nakop))+'$. Ваша ферма - '+farm+'[x'+str(cnt)+']\nДо вывода осталось '+str(datetime.timedelta(seconds = 3600 - (int(time.time())-int(elem.split(' ')[3]))))+'.',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- else:
- keyboard.add_line()
- keyboard.add_button('Снять деньги', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(chat_id = event.chat_id, message = 'Накоплено на ферме - '+str(des(nakop))+'$. Ваша ферма - '+farm+'[x'+str(cnt)+']\nМожно совершить вывод!',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- #if not flag:
- # keyboard = VkKeyboard(inline = True)
- # keyboard.add_button('Фермы', color=VkKeyboardColor.POSITIVE)
- # vk.messages.send(chat_id = event.chat_id, message = 'Биткоин фермы позволяют зарабатывать деньги пассивно! Попробуй:',random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- elif main_mess == 'зов' or main_mess =='объявление':
- if event.from_chat:
- if str(event.user_id)==str(294716376):
- f = vk.messages.getConversationMembers(peer_id = event.peer_id, group_id = 192499164)
- message = ''
- a = vk.users.get(user_ids = event.user_id)
- message += '[id'+str(event.user_id)+'|'+a[0]['first_name']+' '+a[0]['last_name']+'] созвал всех!\n'
- for elem in f['profiles']:
- message += '@id'+str(elem['id'])+' '
- vk.messages.send(peer_id = event.peer_id, message = message, random_id = random.randint(1,999999),disable_mentions = 0)
- elif 'снять деньги' in main_mess:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- for elem1 in array:
- if elem1.split(' ')[0] == str(event.user_id):
- if int(time.time())-int(elem.split(' ')[3])>=3600:
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- flag = True
- farm = elem.split(' ')[1]
- dohod = farms6[farm][1]
- cnt = int(elem.split(' ')[2])
- #datetime.timedelta(seconds = delta)
- nakop = int((int(time.time())-int(elem.split(' ')[3]))/3600*dohod*cnt)
- cena = nakop
- try:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(cena))+' '+elem1.split(' ')[2]+' '+elem1.split(' ')[3]
- except:
- try:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(cena))+' '+elem1.split(' ')[2]
- except:
- array[array.index(elem1)] = elem1.split(' ')[0] +' '+str(int(elem1.split(' ')[1])+int(cena))+' 1'
- array1[array1.index(elem)] = elem.split(' ')[0] + ' '+elem.split(' ')[1]+' '+elem.split(' ')[2]+' '+str(int(time.time()))
- vk.messages.send (chat_id = event.chat_id,message = 'Вы сняли '+str(des(nakop))+'$ с фермы '+elem.split(' ')[1]+'[x'+elem.split(' ')[2]+']', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- else:
- keyboard = VkKeyboard(inline = True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- delta = 3600-(int(time.time())-int(elem.split(' ')[3]))
- vk.messages.send (chat_id = event.chat_id,message = 'Подождите ещё '+str(datetime.timedelta(seconds = delta))+' до следющего снятия денег с фермы!', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("farms.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- elif main_mess=='продать фермы':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("farms.txt") as file:
- array1 = [row.strip() for row in file]
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- cena = int(int(farms6[elem1.split(' ')[1]][0])*int(elem1.split(' ')[2])/3*2)
- del array1[array1.index(elem1)]
- for elem in array:
- if elem.split(' ')[0] == str(event.user_id):
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(cena))+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(cena))+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+str(int(elem.split(' ')[1])+int(cena))+' 1'
- vk.messages.send(chat_id = event.chat_id,message = 'Вы успешно продали фермы за '+str(cena)+'$', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("farms.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- elif 'передать' in main_mess and main_mess.split(' ')[0]=='передать':
- vk.messages.send (chat_id = event.chat_id,message = "Данная команда доступна только в личных сообщениях.",keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='стат':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- vk.messages.send(chat_id = event.chat_id, message = 'Количество всех бесед и людей, написавших что-либо боту - '+str(vk.messages.getConversations(offset = 0, count = 0, filter= "all")['count'])+'\nКоличество играющих пользователей - '+str(len(array)),random_id = random.randint(1,999999),keyboard=keyboard.get_keyboard())
- elif main_mess=='🆔узнать мой id':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'🆔Ваш ID ВКонтакте - '+str(event.user_id),keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif 'id' in main_mess:
- try:
- scr = str(main_mess.split(' ')[1])
- if not '/' in scr:
- e = vk.users.get(user_ids = scr)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'ID Пользователя - ' + str(e[0]['id']),keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- else:
- e1 = scr.split('com/')[1]
- e = vk.users.get(user_ids = e1)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'ID Пользователя - ' + str(e[0]['id']),keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- except:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'использование команды: ID [Ссылка]',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess.split(' ')[0]=='никнейм' or main_mess.split(' ')[0]=='ник':
- new = ''
- try:
- new = event.text.split(' ')[1]
- except:
- pass
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- if len(new)<16:
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if new == '':
- try:
- nick = elem.split(' ')[3]
- vk.messages.send (chat_id = event.chat_id,message = 'Ваш текущий никнейм - '+nick+'.\nСменить никнейм можно командой "Никнейм [Новый никнейм без пробелов]"',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- except:
- vk.messages.send (chat_id = event.chat_id,message = u+'установи свой никнейм с помощью команды! Пример - "Никнейм Василий"',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- if not new == '':
- try:
- array[array.index(elem)]=elem.split(' ')[0] + ' '+elem.split(' ')[1]+' '+elem.split(' ')[2]+' '+new
- except:
- array[array.index(elem)]=elem.split(' ')[0] + ' '+elem.split(' ')[1]+' 1 '+new
- vk.messages.send (chat_id = event.chat_id,message = 'Никнейм установлен.',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- else:
- vk.messages.send (chat_id = event.chat_id,message = 'Максимальная длина никнейма - 16 символов!',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif 'стаканчик' in main_mess:
- try:
- usnum = main_mess.split(' ')[2]
- sum = main_mess.split(' ')[1]
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if int(elem.split(' ')[1])>=int(sum):
- if int(sum)>0:
- randnum = random.randint(1,3)
- if randnum == int(usnum):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])+int(sum)*2) +' '+elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])+int(sum)*2) +' 1'+' '+uu
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])+int(sum)*2))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id, message = u+'поздравляем, вы угадали! +'+des(int(sum)*2)+'$😊\n\nВаш баланс - '+des(int(int(elem.split(' ')[1])+int(sum)*2))+'$', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999))
- sleep(0.03)
- elif not randnum == int(usnum):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])-int(sum)) +' '+elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)]=elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1])-int(sum)) +' 1'+' '+uu
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])-int(sum)))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id, message = u+'не повезло. -'+des(sum)+'$😔\n\nВаш баланс - '+des(int(int(elem.split(' ')[1])-int(sum)))+'$', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999))
- sleep(0.03)
- else:
- keyboard = VkKeyboard(inline=True)
- if not int(elem.split(' ')[1]) == 0:
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send(chat_id = event.chat_id, message = u+"минимальная ставка - 1$!", random_id = random.randint(1,999999), keyboard = keyboard.get_keyboard())
- else:
- keyboard = VkKeyboard(inline=True)
- if not int(elem.split(' ')[1]) == 0:
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send(chat_id = event.chat_id, message = u+"на балансе недостаточно средств!", random_id = random.randint(1,999999), keyboard = keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- except:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Стаканчик ' + str(random.randint(1,int(elem.split(' ')[1])))+' '+str(random.randint(1,3)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id, message = u+'использование команды - стаканчик [сумма] [номер стаканчика]\n Пример: "Стаканчик 5000 2" \n\n Угадай номер стаканчика с шариком и утрой свои деньги🥛💵\n Примечание: если у вас на балансе недостаточно средств, поставить не получится. Минимальная ставка - 1$', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999))
- vk.messages.send(
- chat_id=event.chat_id,
- random_id=get_random_id(),
- sticker_id = 735
- )
- elif main_mess=='🔝топ сейфов':
- with open("safes.txt") as file:
- array = [row.strip() for row in file]
- new = []
- for elem in array:
- try:
- new.append(elem.split(' '))
- except:
- pass
- ####print(int)
- new.sort(key = mone, reverse = True)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- a = ""
- ####print(vk.users.get(user_ids='2,3,4'))
- all_usr= "0"
- for i in range(10):
- all_usr = all_usr +','+ str(new[i][0])
- ####print(all_usr)
- bal = vk.users.get(user_ids=all_usr)
- try:
- for i in range(10):
- add = ''
- if str(new[i][0]) in vip:
- add = '༺VIP༻'
- if str(new[i][0]) == str('294716376'):
- add = '༺Ă ͏̷̬̝̲̳̲͑͆͆̀̃̍Ď ̵̷̡̡̛̥̠͙̤̥͓̥͇̟͇̯̜̭̝̝̗͉̫̱̝͌̅̋͂̀̌̉̌̑̉̇͒̃͑͌̍̉̀̒̚͜͜͡ͅМ ̧͓̝͈͛̆͢͡͝Ĩ ̷̨̮̫̲͇̩̥̂̄͒͂̒͌̈̈͒̃̈́̑̿̉̕͝͠͞Ń ̵̨̘̝̤̯̣̂́̀̒̾͛͒̒̏̓̕͘͝ͅͅ༻'
- try:
- a = a + str((str(i+1)+'. '+add+'[id'+str(new[i][0])+'|'+bal[i]['first_name']+' '+bal[i]['last_name']+'] - ' + des(new[i][1]) +'🔓\n'))
- except:
- pass
- except:
- pass
- vk.messages.send (chat_id = event.chat_id,message = u+'топ взломщиков сейфов:\n'+a,keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif '🔐сейф' in main_mess or 'сейф' in main_mess:
- try:
- usnum = main_mess.split(' ')[1]
- if int(usnum)>0 and int(usnum)<101:
- truenum = random.randint(1,100)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Сейф ' + str(random.randint(1,100)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- if truenum == int(usnum):
- sum = random.randint(0,200000)
- vk.messages.send (chat_id = event.chat_id, message = u+'нииичоси! Повезло так повезло😱 Вы получаете '+des(sum)+'$!' , random_id = random.randint(1,999999))
- vk.messages.send (chat_id = event.chat_id, sticker_id = 7377,keyboard=keyboard.get_keyboard(), random_id = random.randint(1,999999))
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("safes.txt") as file:
- array1 = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)] = elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1]) + sum) + ' ' + elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)] = elem.split(' ')[0] +' '+ str(int(elem.split(' ')[1]) + sum) + ' 1'
- flag = False
- for elem in array1:
- if elem.split(' ')[0] == str(event.user_id):
- array1[array1.index(elem)] = elem.split(' ')[0] + ' '+ str(int(elem.split(' ')[1])+1)
- flag = True
- if not flag:
- array1.append(str(event.user_id)+ ' 1')
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- with open("safes.txt", "w") as file:
- for line in array1:
- file.write(str(line)+"\n")
- else:
- vk.messages.send (chat_id = event.chat_id, message = u+'не повезло!😫 Попробуй ещё раз! Код сейфа - '+str(truenum), keyboard=keyboard.get_keyboard(), random_id = random.randint(1,999999))
- else:
- e = 1/0
- except:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Сейф ' + str(random.randint(1,100)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color = VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id, message = u+'использование команды - сейф [Число от 1 до 100]\n Пример: "сейф 54"\n\n Попробуй подобрать пароль для сейфа и получи до 20.000.000.000$!🤑', keyboard = keyboard.get_keyboard(), random_id = random.randint(1,999999))
- vk.messages.send(
- chat_id=event.chat_id,
- random_id=get_random_id(),
- sticker_id = 733
- )
- elif main_mess=='vip-бонус':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_openlink_button('Оплата', 'https://vk.com/zeo_bot?from=quick_search')
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- if str(event.user_id) in vip:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("vip.txt") as file:
- array1 = [row.strip() for row in file]
- ####print(array)
- flag = False
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- flag = True
- delta = int(elem1.split(' ')[1])+10800-int(time.time())
- text = str(datetime.timedelta(seconds = delta))
- if int(int(elem1.split(' ')[1])+10800)<=int(time.time()):
- sum = random.randint(0,1000000)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- vk.messages.send (chat_id = event.chat_id,message =u+"вы получаете "+str(des(sum))+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1[array1.index(elem1)] = str(event.user_id)+' '+str(int(time.time()))
- else:
- vk.messages.send (chat_id = event.chat_id,message ="Подождите ещё "+text+" до получения следующего бонуса!", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if flag == False:
- array1.append(str(event.user_id)+' '+str(int(time.time())))
- ####print(str(event.user_id)+' '+str(int(time.time())))
- with open("test.txt", "w") as file:
- for line in array:
- ####print(str(line))
- file.write(str(line)+"\n")
- with open("vip.txt", "w") as file:
- for line in array1:
- ####print(str(line))
- file.write(str(line)+"\n")
- else:
- vk.messages.send (chat_id = event.chat_id,message ="Данная команда доступна только VIP-Пользователям.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard(), )
- elif main_mess=='выключить рассылки':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- array[array.index(elem)] = elem.split(' ')[0] +' '+ elem.split(' ')[1] + ' 0'+' '+uu
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Включить рассылки', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'успешно. Если надумаете снова включить рассылки, то можете сделать это в любое время через настройки😄',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='включить рассылки':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- array[array.index(elem)] = elem.split(' ')[0] +' '+ elem.split(' ')[1] + ' 1'+' '+uu
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Выключить рассылки', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'успешно. Спасибо!💙',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif main_mess=='рассылки':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- try:
- ####print(elem.split(' ')[2])
- status = elem.split(' ')[2]
- except:
- array[array.index(elem)] = elem + ' 1'
- status = '1'
- if status == '1':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Выключить рассылки', color=VkKeyboardColor.NEGATIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'текущий статус рассылок - ВКЛ',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- if status == '0':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Включить рассылки', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'текущий статус рассылок - ВЫКЛ',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif main_mess=='⚙настройки':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Рассылки', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Никнейм', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u+'выберите нужную категорию настроек.',keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='🔝топ игроков':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- new = []
- for elem in array:
- try:
- new.append(elem.split(' '))
- except:
- pass
- ####print(int)
- new.sort(key = mone, reverse = True)
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- a = ""
- ####print(vk.users.get(user_ids='2,3,4'))
- all_usr= "0"
- for i in range(10):
- all_usr = all_usr +','+ str(new[i][0])
- ####print(all_usr)
- bal = vk.users.get(user_ids=all_usr)
- for i in range(10):
- add = ''
- if str(new[i][0]) in vip:
- add = '༺VIP༻'
- if str(new[i][0]) == str('294716376'):
- add = '༺Ă ͏̷̬̝̲̳̲͑͆͆̀̃̍Ď ̵̷̡̡̛̥̠͙̤̥͓̥͇̟͇̯̜̭̝̝̗͉̫̱̝͌̅̋͂̀̌̉̌̑̉̇͒̃͑͌̍̉̀̒̚͜͜͡ͅМ ̧͓̝͈͛̆͢͡͝Ĩ ̷̨̮̫̲͇̩̥̂̄͒͂̒͌̈̈͒̃̈́̑̿̉̕͝͠͞Ń ̵̨̘̝̤̯̣̂́̀̒̾͛͒̒̏̓̕͘͝ͅͅ༻'
- try:
- a = a + str((str(i+1)+'. '+add+'[id'+str(new[i][0])+'|'+bal[i]['first_name']+' '+bal[i]['last_name']+'] - ' + des(new[i][1]) +'$\n'))
- except:
- pass
- vk.messages.send (chat_id = event.chat_id,message = u+'топ игроков бота:\n'+a,keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- elif main_mess=='казино все' or main_mess=='казино всё':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- if int(elem.split(' ')[1])>0:
- kef=random.randint(0,8)*0.25
- wow = False
- if kef==2 and random.randint(0,9)==0:
- kef = 4
- wow = True
- if kef==2 and random.randint(0,20)==0:
- kef = 10
- wow = True
- if kef == 2 and random.randint(0,30)==0:
- kef = 30
- wow = True
- comis = 0.01
- if str(elem.split(' ')[0]) in vip:
- comis = 0.005
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- newbalance = str(int(int(elem.split(' ')[1])*kef*(1-comis)))
- daykomis = daykomis + int(int(elem.split(' ')[1])*kef*(comis))
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' 1'
- if kef==1:
- mess="Ваши деньги остаются при вас.["
- elif kef>1:
- mess="Поздравляем! Вы выиграли с коэффициентом ["
- elif kef<1:
- mess="Увы, вы проиграли с коэффициентом ["
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- if kef>0:
- keyboard.add_line()
- keyboard.add_button('Казино 100%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 50%', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино 25%', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u + mess+"x"+str(kef)+"]\n"+'Ваш баланс - ' + des(newbalance)+"$\nКомиссия - "+str(float(comis)*100)+'%', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if wow == True:
- vk.messages.send (chat_id = event.chat_id, sticker_id = 726, random_id = time.time())
- stik = [14256,12689]
- if kef == 0:
- vk.messages.send (chat_id = event.chat_id,sticker_id = stik[random.randint(0,1)], random_id = random.randint(1, 999999))
- else:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = "Минимальная ставка - 1$!", random_id = random.randint(1, 999999), keyboard = keyboard.get_keyboard())
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- elif main_mess=='бонус':
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- with open("bonus.txt") as file:
- array1 = [row.strip() for row in file]
- ####print(array)
- flag = False
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- for elem1 in array1:
- if elem1.split(' ')[0] == str(event.user_id):
- flag = True
- delta = int(elem1.split(' ')[1])+86400-int(time.time())
- text = str(datetime.timedelta(seconds = delta))
- if int(int(elem1.split(' ')[1])+86400)<=int(time.time()):
- sum = random.randint(1,100000)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- vk.messages.send (chat_id = event.chat_id,message =u+"вы получаете "+str(sum)+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1[array1.index(elem1)] = str(event.user_id)+' '+str(int(time.time()))
- else:
- vk.messages.send (chat_id = event.chat_id,message ="Подождите ещё "+text+" до получения следующего бонуса!", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if flag == False:
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- sum = random.randint(1,100000)
- ####print(sum)
- try:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- #try:
- #array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' '+elem.split(' ')[2]
- #except:
- array[array.index(elem)]=str(event.user_id)+' '+str(int(elem.split(' ')[1])+sum)+' 1'
- ####print(sum)
- vk.messages.send (chat_id = event.chat_id,message =u+"вы получаете "+str(des(sum))+"$.", random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- array1.append(str(event.user_id)+' '+str(int(time.time())))
- ####print(str(event.user_id)+' '+str(int(time.time())))
- with open("test.txt", "w") as file:
- for line in array:
- ####print(str(line))
- file.write(str(line)+"\n")
- with open("bonus.txt", "w") as file:
- for line in array1:
- ####print(str(line))
- file.write(str(line)+"\n")
- #vk.messages.send(peer_id = event.peer_id,message = 'Welcome to the menu! \n T E S T', random_id = random.randint(1, 999999))
- elif main_mess=='🎰казино':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Казино всё', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино '+str(int(int(elem.split(' ')[1])/2)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино '+str(int(int(elem.split(' ')[1])/4)), color=VkKeyboardColor.POSITIVE)
- vk.messages.send(chat_id = event.chat_id,keyboard=keyboard.get_keyboard(),message = 'Использование команды:\nКазино [Сумма]/Всё', random_id = random.randint(1, 999999))
- elif 'казино' in main_mess:
- sum=0
- try:
- sum = int(main_mess.split(' ')[1])
- except:
- pass
- if sum>0:
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- balance = int(elem.split(' ')[1])
- ####print(balance)
- kef=random.randint(0,8)*0.25
- wow = False
- if kef == 2 and random.randint(0,9)==0:
- kef = 4
- wow = True
- if kef == 2 and random.randint(0,20)==0:
- kef = 10
- wow = True
- if kef == 2 and random.randint(0,30)==0:
- kef = 30
- wow = True
- if str(elem.split(' ')[0]) in vip:
- comis = 0.005
- else:
- comis = 0.01
- newbalance = str(int(int(int(elem.split(' ')[1])-sum+(sum*kef*(1-comis)))))
- daykomis = daykomis + int(sum*kef*(comis))
- if sum<=balance:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]+' '+elem.split(' ')[3]
- except:
- try:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' '+elem.split(' ')[2]
- except:
- array[array.index(elem)]=str(event.user_id)+' '+newbalance+' 1'
- if kef==1:
- mess="ваши деньги остаются при вас. ["
- elif kef>1:
- mess="поздравляем! Вы выиграли с коэффициентом ["
- elif kef<1:
- mess="увы, вы проиграли с коэффициентом ["
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Казино всё', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино '+str(int(int((balance-sum)+sum*kef)/2)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Казино '+str(int(int((balance-sum)+sum*kef)/4)), color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message = u + mess+"x"+str(kef)+"]\n"+'Ваш баланс - ' + des(newbalance)+"$\nКомиссия - "+str(float(comis)*100)+'%', random_id = random.randint(1, 999999),keyboard=keyboard.get_keyboard())
- if wow == True:
- vk.messages.send (chat_id = event.chat_id, sticker_id = 726, random_id = time.time())
- sleep(0.03)
- else:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send (chat_id = event.chat_id,message ="На вашем балансе нет столько денег! Ваш баланс - "+des(int(balance))+"$",keyboard=keyboard.get_keyboard(), random_id = random.randint(1, 999999))
- with open("test.txt", "w") as file:
- for line in array:
- ####print(str(line))
- file.write(str(line)+"\n")
- else:
- keyboard = VkKeyboard(inline=True)
- keyboard.add_button('Обратно в меню', color=VkKeyboardColor.POSITIVE)
- vk.messages.send(chat_id = event.chat_id,keyboard=keyboard.get_keyboard(),message = 'Минимальная ставка - 1$!', random_id = random.randint(1, 999999))
- elif main_mess=='меню' or main_mess=='обратно в меню':
- keyboard = VkKeyboard(one_time=False)
- with open("bonus.txt") as file:
- array = [row.strip() for row in file]
- ####print(array)
- posi = False
- keyboard.add_button('VIP-Бонус', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- for elem in array:
- if elem.split(' ')[0]==str(event.user_id):
- flag = True
- if int(int(elem.split(' ')[1])+86400)<=int(time.time()):
- keyboard.add_button('Бонус', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- posi = True
- if posi == False:
- keyboard.add_button('Бонус', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('💰Баланс', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('🎰Казино', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('🔐Сейф', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('🥛Стаканчик', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Комиссия', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('🆔Узнать мой ID', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('🆔Узнать ID по ссылке', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('🔝Топ игроков', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('🔝Топ сейфов', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('⚙Настройки', color=VkKeyboardColor.PRIMARY)
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- vk.messages.send(
- chat_id=event.chat_id,
- random_id=get_random_id(),
- keyboard=keyboard.get_keyboard(),
- message=u+'добро пожаловать в меню!'
- )
- vk.messages.send(
- chat_id=event.chat_id,
- random_id=get_random_id(),
- sticker_id = 9880
- )
- else:
- nul = True
- #vk.messages.send(
- #chat_id=event.chat_id,
- #random_id=get_random_id(),
- #keyboard=keyboard.get_keyboard(),
- #message=' '
- #)
- if str(event.user_id)==str(294716376):
- ####print(event.attachments)
- mas = event.text.split(' ',1)
- if mas[0]=='рассылка':
- if False:
- add = ''
- try:
- arr = event.attachments
- except:
- pass
- if not len(arr)==0:
- for i in range(int(int(len(arr))/2)):
- i = i + 1
- add = add + arr['attach'+str(i)+'_type'] + arr['attach'+str(i)] + ','
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- try:
- if elem.split(' ')[2] == '1':
- id=elem.split(' ')[0]
- try:
- vk.messages.send (user_id = id,message = str(mas[1]),keyboard=keyboard.get_keyboard(),attachment = add, random_id = random.randint(1, 999999))
- except:
- pass
- except:
- id=elem.split(' ')[0]
- try:
- vk.messages.send (user_id = id,message = str(mas[1]),keyboard=keyboard.get_keyboard(),attachment = add, random_id = random.randint(1, 999999))
- except:
- pass
- if mas[0]=='выдать':
- with open("test.txt") as file:
- array = [row.strip() for row in file]
- for elem in array:
- if elem.split(' ')[0]==mas[1].split(' ')[0]:
- try:
- uu = elem.split(' ')[3]
- except:
- pass
- try:
- array[array.index(elem)]=str(elem.split(' ')[0])+' '+str(int(elem.split(' ')[1])+int(mas[1].split(' ')[1]))+' '+elem.split(' ')[2]+' '+uu
- except:
- array[array.index(elem)]=str(elem.split(' ')[0])+' '+str(int(elem.split(' ')[1])+int(mas[1].split(' ')[1]))
- with open("test.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- id = mas[1].split(' ')[0]
- try:
- vk.messages.send(user_id=id, message = 'Администратор начислил на ваш баланс ' + des(mas[1].split(' ')[1])+'$!', random_id=random.randint(1,999999))
- except:
- pass
- vk.messages.send(chat_id=event.chat_id, message = 'Успешно. Начислено ' + des(mas[1].split(' ')[1])+'$ [id'+str(id)+'|игроку].', random_id=random.randint(1,999999))
- if not event.chat_id == 5:
- pass
- elif not nul:
- vk.messages.send (chat_id = event.chat_id,message = 'Эта беседа создана для общения😉\nБеседа для использования бота находится в закрепе👽', random_id = random.randint(1, 999999))
- if last_pend>-1:
- last_pend = event.user_id
- elif event.type == VkEventType.MESSAGE_NEW and event.to_me:
- if event.from_user:
- try:
- if event.attachments['attach1_type']=='sticker':
- idstik = event.attachments['attach1']
- vk.messages.send (peer_id = event.peer_id,message = 'ID стикера - '+str(idstik)+'\nСсылка на этот стикер как картинку -\nhttps://vk.com/sticker/1-'+idstik+'-512b', random_id = random.randint(1, 999999))
- else:
- vk.messages.send(
- peer_id = event.peer_id,
- random_id=get_random_id(),
- message = phr[random.randint(0,len(phr)-1)]
- )
- except:
- pass
- elif event.type == VkEventType.MESSAGE_NEW and event.text:
- ##print(event.text)
- pass
- if event.type == VkEventType.MESSAGE_NEW and event.to_me:
- if random.randint(1,5) == 2:
- vk.messages.send(peer_id = event.peer_id, message = '🔔Полезный совет:\n'+random.choice(hel), random_id = random.randint(1,99999999999))
- #if event.type == VkEventType.group_join:
- #vk.messages.send(peer_id = event.peer_id, message = 'Спасибо за подписку на группу!🙃', random_id = time.time())
- ####print('SUUUUB')
- #if event.type == VkEventType.GROUP_LEAVE:
- #vk.messages.send(peer_id = event.peer_id, message = 'Жаль, что вы уходите😔', random_id = time.time())
- ####print('LEAVE')
- ####print(event.group_id)
- ###print(event.type)
- except Exception as e:
- ####print(e)
- vk.messages.send(user_id=294716376, message = str(e), random_id=random.randint(1,999999))
- def f_1():
- while True:
- global idcurr, daykomis, yester
- with open("konk.txt") as file:
- array = [row.strip() for row in file]
- array[0] = str(idcurr)+' '+str(daykomis)+' '+str(yester)
- schedule.run_pending()
- with open("konk.txt", "w") as file:
- for line in array:
- file.write(str(line)+"\n")
- time.sleep(1)
- #while True:
- if False:
- try:
- s = requests.Session()
- s.headers['authorization'] = 'Bearer ' + api_access_token
- parameters = {'rows': '1'}
- h = s.get('https://edge.qiwi.com/payment-history/v1/persons/'+my_login+'/payments', params = parameters)#####print(json.loads(h.text))#####print(h.text)
- new=json.loads(h.text)
- curr_num=int(new['data'][0]['txnId'])
- ####print(" - " + str (new['data'][0]['sum']['amount']) + "р")
- ####print(" -"+str(new['data'][0]["account"]))
- ####print(" - '"+str(new['data'][0]["comment"])+"'")
- #####print(yoy['lava'][0])
- # ####print(new['data'])
- uavv=[]
- abc = str(new['data'][0]["comment"])
- #####print(abc)
- uavv=abc.split(" ")
- ya=1
- uavv2=str(last_mess).split(" ")
- time.sleep(2000)
- try:
- #####print(uavv)
- idvk=int(uavv[0])
- ya=int(idvk)
- except:
- yyy=0
- yyy=yyy
- except:
- pass
- th_1, th_2 = Thread(target=f), Thread(target = f_1)
- if __name__ == '__main__':
- th_1.start(), th_2.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement