├── nomis_bot.log
├── proxy.txt
├── utils
├── __init__.py
├── core
│ ├── __init__.py
│ ├── logger.py
│ └── register.py
├── telegram.py
└── nomis.py
├── requirements.txt
├── data
└── config.py
├── main.py
└── README.md
/nomis_bot.log:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/proxy.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/utils/__init__.py:
--------------------------------------------------------------------------------
1 | from .nomis import Nomis
2 | from .telegram import Accounts
3 |
--------------------------------------------------------------------------------
/utils/core/__init__.py:
--------------------------------------------------------------------------------
1 | from .logger import logger
2 | from .register import create_sessions
3 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | pyrogram==2.0.106
2 | tgcrypto==1.2.5
3 | loguru==0.7.2
4 | aiohttp==3.9.5
5 | fake-useragent==1.5.1
6 | requests==2.28.1
7 |
8 |
--------------------------------------------------------------------------------
/utils/core/logger.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import requests
3 | from loguru import logger
4 | from data import config
5 |
6 | TELEGRAM_API_URL = f"https://api.telegram.org/bot{config.BOT_TOKEN}/sendMessage"
7 | def send_log_to_telegram(message):
8 | try:
9 | response = requests.post(TELEGRAM_API_URL, data={'chat_id': config.CHAT_ID, 'text': message})
10 | if response.status_code != 200:
11 | logger.error(f"Failed to send log to Telegram: {response.text}")
12 | except Exception as e:
13 | logger.error(f"Failed to send log to Telegram: {e}")
14 |
15 | def logging_setup():
16 | format_info = "{time:HH:mm:ss.SS} | {level} | {message}"
17 | logger.remove()
18 |
19 | logger.add(sys.stdout, colorize=True, format=format_info, level="INFO")
20 | logger.add("nomis_bot.log", rotation="50 MB", compression="zip", format=format_info, level="TRACE")
21 | if config.USE_TG_BOT:
22 | logger.add(lambda msg: send_log_to_telegram(msg), format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}", level="INFO")
23 |
24 | logging_setup()
25 |
--------------------------------------------------------------------------------
/data/config.py:
--------------------------------------------------------------------------------
1 | # api id, hash
2 | API_ID = 111111
3 | API_HASH = 'hash'
4 |
5 | USE_TG_BOT = False # True if you want use tg, else False
6 | BOT_TOKEN = '' # API TOKEN get in @BotFather
7 | CHAT_ID = '' # Your telegram id
8 |
9 | # задержка между подключениями к аккаунтам
10 | ACC_DELAY = [1,300]
11 |
12 | # рефка например ref_SpmeVi1tSP
13 | REFERRAL_CODE = ""
14 |
15 | # тип прокси
16 | PROXY_TYPE = "socks5" # http/socks5
17 |
18 | # какой часовой пояс на сервере или устройстве +3UTC = 180(минуты)
19 | UTC = 180
20 |
21 | # папка с сессиями (не менять)
22 | WORKDIR = "sessions/"
23 |
24 | # использование прокси
25 | USE_PROXY = True # True/False
26 | # проверять прокси
27 | CHECK_PROXY = True
28 |
29 | # задержка между клеймом и стартом фарминга
30 | START_SLEEP = [30,60]
31 |
32 | # задержка между тасками
33 | TASKS_SLEEP = [20,40]
34 |
35 | # задержка между кругами
36 | END_SLEEP = [5000,10000]
37 |
38 | # мини задержки
39 | MINI_SLEEP = [1,20] #[min,max]
40 |
41 |
42 | hello =''' _ __ _
43 | _ __ ___ | |_ _ _ __ _ ___ ___ / _|| |_ ___
44 | | '_ \ / _ \| __|| | | | / _` |/ __| / _ \ | |_ | __|/ __|
45 | | |_) || __/| |_ | |_| || (_| |\__ \| (_) || _|| |_ \__ \\
46 | | .__/ \___| \__| \__, | \__,_||___/ \___/ |_| \__||___/
47 | |_| |___/
48 |
49 | '''
50 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | from utils.core import create_sessions
2 | from utils.telegram import Accounts
3 | from utils.nomis import Nomis
4 | from data.config import hello,USE_PROXY
5 | import asyncio
6 | import os
7 |
8 | async def main():
9 | print(hello)
10 | action = int(input('Выберите действие:\n1. Начать сбор монет\n2. Создать сессию\n>'))
11 |
12 | if not os.path.exists('sessions'):
13 | os.mkdir('sessions')
14 |
15 | if action == 2:
16 | await create_sessions()
17 |
18 | if action == 1:
19 | accounts = await Accounts().get_accounts()
20 |
21 | tasks = []
22 | if USE_PROXY:
23 | proxy_dict = {}
24 | with open('proxy.txt','r',encoding='utf-8') as file:
25 | list = [i.strip().split() for i in file.readlines()]
26 | proxy = []
27 | for info in list:
28 | if info!=[]:
29 | proxy.append((info[0],''.join(info[1:]).replace('.session','')))
30 | for prox,name in proxy:
31 | proxy_dict[name] = prox
32 | for thread, account in enumerate(accounts):
33 | if account in proxy_dict:
34 | tasks.append(asyncio.create_task(Nomis(account=account, thread=thread, proxy=proxy_dict[account]).main()))
35 | else:
36 | tasks.append(asyncio.create_task(Nomis(account=account, thread=thread,proxy = None).main()))
37 | else:
38 | for thread, account in enumerate(accounts):
39 | tasks.append(asyncio.create_task(Nomis(account=account, thread=thread,proxy = None).main()))
40 | await asyncio.gather(*tasks)
41 |
42 | if __name__ == '__main__':
43 | asyncio.run(main())
44 |
45 |
--------------------------------------------------------------------------------
/utils/core/register.py:
--------------------------------------------------------------------------------
1 | from loguru import logger
2 | from data import config
3 | import pyrogram
4 | from data.config import USE_PROXY
5 |
6 | async def create_sessions():
7 | while True:
8 | session_name = input('Введите название сессии (для выхода нажмите Enter)\n')
9 | if not session_name:
10 | return
11 |
12 | if USE_PROXY:
13 | proxy_dict = {}
14 | with open('proxy.txt','r',encoding='utf-8') as file:
15 | list = [i.strip().split() for i in file.readlines()]
16 | proxy = []
17 | for info in list:
18 | if info!=[]:
19 | proxy.append((info[0],''.join(info[1:]).replace('.session','')))
20 | for prox,name in proxy:
21 | proxy_dict[name] = prox
22 |
23 | if session_name in proxy_dict:
24 | proxy = proxy_dict[session_name]
25 | proxy_client = {
26 | "scheme": config.PROXY_TYPE,
27 | "hostname": proxy.split(':')[0],
28 | "port": int(proxy.split(':')[1]),
29 | "username": proxy.split(':')[2],
30 | "password": proxy.split(':')[3],
31 | }
32 |
33 | session = pyrogram.Client(
34 | api_id=config.API_ID,
35 | api_hash=config.API_HASH,
36 | name=session_name,
37 | workdir=config.WORKDIR,
38 | proxy=proxy_client
39 | )
40 |
41 | async with session:
42 | user_data = await session.get_me()
43 |
44 | logger.success(f'Добавлена сессия +{user_data.phone_number} @{user_data.username} PROXY {proxy.split(":")[0]}')
45 | else:
46 | if config.CHECK_PROXY:
47 | logger.error(f"{session_name}.session ПРОКСИ НЕ НАЙДЕН")
48 | return False
49 |
50 | session = pyrogram.Client(
51 | api_id=config.API_ID,
52 | api_hash=config.API_HASH,
53 | name=session_name,
54 | workdir=config.WORKDIR
55 | )
56 |
57 | async with session:
58 | user_data = await session.get_me()
59 |
60 | logger.success(f'Добавлена сессия +{user_data.phone_number} @{user_data.username} PROXY : NONE')
61 | else:
62 |
63 | session = pyrogram.Client(
64 | api_id=config.API_ID,
65 | api_hash=config.API_HASH,
66 | name=session_name,
67 | workdir=config.WORKDIR
68 | )
69 |
70 | async with session:
71 | user_data = await session.get_me()
72 |
73 | logger.success(f'Добавлена сессия +{user_data.phone_number} @{user_data.username} PROXY : NONE')
74 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Software for Nomis App telegram Bot
3 |
4 | ## Requirements
5 | - Python 3.11 (you can install it [here](https://www.python.org/downloads/release/python-3110/))
6 | - Telegram API_ID and API_HASH (you can get them [here](https://my.telegram.org/auth?to=apps))
7 |
8 |
9 |
10 | 1. Install the required dependencies:
11 | ```bash
12 | pip install -r requirements.txt
13 | ```
14 |
15 | 2. Get your API_ID and API_HASH:
16 | - Go to [my.telegram.org](https://my.telegram.org/auth?to=apps)
17 | - Sign in with your Telegram account
18 | - Create a new application to get your API_ID and API_HASH
19 |
20 | 3. Configure the application:
21 | - Open `config.py` and add your `API_ID` and `API_HASH`:
22 | ```python
23 | API_ID = your_api_id
24 | API_HASH = 'your_api_hash'
25 | ```
26 |
27 | - If you want to use a proxy, set `USE_PROXY` in `config.py` to `True`, otherwise set it to `False`:
28 | ```python
29 | USE_PROXY = True # or False
30 | ```
31 |
32 | - If `USE_PROXY` is `True`, open `proxy.txt` and fill it out using the example provided. Ensure there are no extra lines in the file.
33 | Proxy format : ip:port:login:password session_name, session name is which use this proxy (WITHOUT .session, only session name)
34 | ```txt
35 | 192.168.1.1:1234:username:password session1
36 | 192.168.1.2:2934:username:password session2
37 | 192.168.1.3:3834:username:password session3
38 | 192.168.5.1:2884:username:password session4
39 | ```
40 | And don't forget set proxy type in `config.py`
41 | ```python
42 | PROXY_TYPE = "socks5" # or http
43 | ```
44 |
45 | And don't forget set your referral code
46 | ```python
47 | REFERRAL_CODE = "ref_SpmeVi1tSP"
48 | ```
49 |
50 | And you can edit set your referral code
51 | ```python
52 | START_SLEEP = [30,60]
53 | TASKS_SLEEP = [20,40]
54 | END_SLEEP = [5000,10000]
55 | MINI_SLEEP = [1,20]
56 | ```
57 | For example END_SLEEP it is random sleep time from 5000 to 10000 seconds
58 |
59 |
60 | 5. IMPORTANT Create a `sessions` folder
61 |
62 |
63 |
64 | ## Usage
65 |
66 | 1. Run the bot:
67 | ```bash
68 | python main.py
69 | ```
70 |
71 | 2. The software will work with all accounts using the single `API_ID` and `API_HASH`. No need to change them for each account.
72 |
73 | ## Important Notes
74 |
75 | - **Python Version:** The software runs on Python 3.11. Using a different version may cause errors.
76 | - DONT USE MAIN ACCOUNT BECAUSE THERE IS ALWAYS A CHANCE TO GET BANNED IN TELEGRAM
77 |
78 |
79 | ---
80 |
81 | DONATIONS
82 | ```txt
83 | ton : UQCLxqnBscAH1i8WNU2qfqXrAKCd5AoNgbuNrvZHTZOLI3Yg
84 |
85 | sol : BKmvLTyW29Pkb1yixJrUh6q6JgCkyqY5VGAN5DwgLatK
86 |
87 | ltc : ltc1q4jxmwt2hrwz05jgplaxsx7ytdmyd06n9w43qtx
88 |
89 | btc : bc1qfhy5de2xmewzlyd8gct8e8lxxwkm33u359sxpe
90 |
91 | evm : 0xffD503AD80C9486D8588fD0DE2E129F2F0E1d618
92 |
93 | trc20 : TN6qKhsbjB1WaetixdRigNrmUw1MCqAyh3
94 |
95 | dash : Xu4VUgxQTKk5URkbgMiZv6uLzJpHR4NH6y
96 |
97 | zec : t1aFA4poLSA6psJ1pbsK63MeXKQ6ECkqz5M
98 | ```
99 |
100 | Thank you for using NomisApp Telegram Bot! Don't forget to follow our [Telegram channel](https://t.me/petyasofts) for updates.
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/utils/telegram.py:
--------------------------------------------------------------------------------
1 | from utils.core import logger
2 | from pyrogram import Client
3 | from data import config
4 | import os
5 |
6 | class Accounts:
7 | def __init__(self):
8 | self.workdir = config.WORKDIR
9 | self.api_id = config.API_ID
10 | self.api_hash = config.API_HASH
11 |
12 | def pars_sessions(self):
13 | sessions = []
14 | for file in os.listdir(self.workdir):
15 | if file.endswith(".session"):
16 | sessions.append(file.replace(".session", ""))
17 |
18 | logger.info(f"Найдено сессий: {len(sessions)}!")
19 | return sessions
20 |
21 | async def check_valid_sessions(self, sessions: list):
22 | logger.info(f"Проверяю сессии на валидность!")
23 | valid_sessions = []
24 | if config.USE_PROXY:
25 | proxy_dict = {}
26 | with open('proxy.txt','r') as file:
27 | list = [i.strip().split() for i in file.readlines()]
28 | proxy_list = []
29 | for info in list:
30 | if info!=[]:
31 | proxy_list.append((info[0],''.join(info[1:]).replace('.session','')))
32 | for prox,name in proxy_list:
33 | proxy_dict[name] = prox
34 | for session in sessions:
35 | try:
36 | if session in proxy_dict:
37 | proxy = proxy_dict[session]
38 | proxy_client = {
39 | "scheme": config.PROXY_TYPE,
40 | "hostname": proxy.split(':')[0],
41 | "port": int(proxy.split(':')[1]),
42 | "username": proxy.split(':')[2],
43 | "password": proxy.split(':')[3],
44 | }
45 | client = Client(name=session, api_id=self.api_id, api_hash=self.api_hash, workdir=self.workdir,proxy=proxy_client)
46 |
47 | if await client.connect():
48 | valid_sessions.append(session)
49 | else:
50 | logger.error(f"{session}.session is invalid")
51 |
52 | await client.disconnect()
53 | else:
54 | if config.CHECK_PROXY:
55 | logger.error(f"{session}.session ПРОКСИ НЕ НАЙДЕН")
56 | continue
57 | client = Client(name=session, api_id=self.api_id, api_hash=self.api_hash, workdir=self.workdir)
58 |
59 | if await client.connect():
60 | valid_sessions.append(session)
61 | else:
62 | logger.error(f"{session}.session is invalid")
63 | await client.disconnect()
64 | except:
65 | logger.error(f"{session}.session is invalid")
66 | logger.success(f"Валидных сессий: {len(valid_sessions)}; Невалидных: {len(sessions)-len(valid_sessions)}")
67 |
68 | else:
69 | for session in sessions:
70 | try:
71 | client = Client(name=session, api_id=self.api_id, api_hash=self.api_hash, workdir=self.workdir)
72 |
73 | if await client.connect():
74 | valid_sessions.append(session)
75 | else:
76 | logger.error(f"{session}.session is invalid")
77 | await client.disconnect()
78 | except:
79 | logger.error(f"{session}.session is invalid")
80 | logger.success(f"Валидных сессий: {len(valid_sessions)}; Невалидных: {len(sessions)-len(valid_sessions)}")
81 | return valid_sessions
82 |
83 | async def get_accounts(self):
84 | sessions = self.pars_sessions()
85 | accounts = await self.check_valid_sessions(sessions)
86 |
87 | if not accounts:
88 | raise ValueError("Нет валидных сессий")
89 | else:
90 | return accounts
91 |
--------------------------------------------------------------------------------
/utils/nomis.py:
--------------------------------------------------------------------------------
1 | from urllib.parse import parse_qs,unquote
2 | from utils.core import logger
3 | from fake_useragent import UserAgent
4 | from pyrogram import Client
5 | from data import config
6 | from datetime import datetime, timezone
7 |
8 | from pyrogram.raw.functions.messages import RequestAppWebView
9 | from pyrogram.raw.types import InputBotAppShortName
10 | import requests
11 | import aiohttp
12 | import asyncio
13 | import random
14 | import json
15 | import time
16 |
17 |
18 | class Nomis:
19 | def __init__(self, thread: int, account: str, proxy : str):
20 | self.thread = thread
21 | self.name = account
22 | if proxy:
23 | proxy_client = {
24 | "scheme": config.PROXY_TYPE,
25 | "hostname": proxy.split(':')[0],
26 | "port": int(proxy.split(':')[1]),
27 | "username": proxy.split(':')[2],
28 | "password": proxy.split(':')[3],
29 | }
30 | self.client = Client(name=account, api_id=config.API_ID, api_hash=config.API_HASH, workdir=config.WORKDIR, proxy=proxy_client)
31 | else:
32 | self.client = Client(name=account, api_id=config.API_ID, api_hash=config.API_HASH, workdir=config.WORKDIR)
33 |
34 | if proxy:
35 | self.proxy = f"{config.PROXY_TYPE}://{proxy.split(':')[2]}:{proxy.split(':')[3]}@{proxy.split(':')[0]}:{proxy.split(':')[1]}"
36 | else:
37 | self.proxy = None
38 | headers = {
39 | 'accept': 'application/json, text/plain, */*',
40 | 'accept-language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
41 | 'content-type': 'application/json',
42 | 'origin': 'https://telegram.nomis.cc',
43 | 'priority': 'u=1, i',
44 | 'referer': 'https://telegram.nomis.cc/',
45 | 'sec-fetch-dest': 'empty',
46 | 'sec-fetch-mode': 'cors',
47 | 'sec-fetch-site': 'same-site',
48 | 'user-agent': UserAgent().random,
49 | }
50 | self.session = aiohttp.ClientSession(headers=headers, trust_env=True, connector=aiohttp.TCPConnector(verify_ssl=False))
51 |
52 | async def main(self):
53 | await asyncio.sleep(random.uniform(*config.ACC_DELAY))
54 | while True:
55 | try:
56 | tg_webdata = await self.get_tg_web_data()
57 | if not tg_webdata:
58 | await self.session.close()
59 | return 0
60 | user_info = await self.auth()
61 | if user_info == False:
62 | await self.session.close()
63 | return 0
64 | logger.info(f"NOMIS | main | Thread {self.thread} | {self.name} | Start! | PROXY : {self.proxy}")
65 | except Exception as err:
66 | logger.error(f"NOMIS | main | Thread {self.thread} | {self.name} | {err}")
67 | await self.session.close()
68 | return 0
69 | try:
70 | farm_data = await self.farm_data()
71 | if farm_data['nextFarmClaimAt'] == None:
72 | await self.start_farm()
73 | else:
74 | ts_now = datetime.now(tz=timezone.utc).timestamp()*1000
75 | farm_end = self.convert_to_timestamp(date_str=farm_data['nextFarmClaimAt'])
76 | if farm_end <= ts_now:
77 | await self.claim_farm()
78 | await asyncio.sleep(random.uniform(*config.START_SLEEP))
79 | await self.start_farm()
80 |
81 | tasks_list = await self.get_tasks()
82 | await asyncio.sleep(random.uniform(*config.MINI_SLEEP))
83 | for tasks in tasks_list:
84 | tasks = tasks['ton_twa_tasks']
85 | for task in tasks:
86 | if task['id'] in [146,145,144,147,196,171,17,201,198,199,200,95,40,167,125,103,115,5,103,61,23,140,141,206,200]:
87 | continue
88 | if random.randint(0,1) == 0:
89 | await self.verify_task(task_id=task['id'])
90 | await asyncio.sleep(random.uniform(*config.TASKS_SLEEP))
91 |
92 | logger.info(f"NOMIS | main | Thread {self.thread} | {self.name} | Круг окончен")
93 | await asyncio.sleep(random.uniform(*config.END_SLEEP))
94 | except Exception as err:
95 | logger.error(f"NOMIS | main | Thread {self.thread} | {self.name} | {err}")
96 | await asyncio.sleep(5*random.randint(*config.MINI_SLEEP))
97 |
98 | async def get_tasks(self):
99 | resp = await self.session.get("https://cms-api.nomis.cc/api/users/tasks",proxy = self.proxy)
100 | return await resp.json()
101 |
102 | async def verify_task(self,task_id : int):
103 | try:
104 | json_data = {
105 | 'task_id': task_id,
106 | }
107 |
108 | response = await self.session.post('https://cms-api.nomis.cc/api/users/claim-task',json=json_data,proxy = self.proxy)
109 | if (await response.json())['data']['result']:
110 | logger.success(f"NOMIS | verify_task | Thread {self.thread} | {self.name} | Claimed {(await response.json())['data']['reward']/1000}")
111 | return await response.json()
112 | except:
113 | pass
114 |
115 |
116 | async def farm_data(self):
117 | response = await self.session.get('https://cms-api.nomis.cc/api/users/farm-data',proxy=self.proxy)
118 | return await response.json()
119 |
120 |
121 | async def claim_farm(self):
122 | json_data = {}
123 | response = await self.session.post("https://cms-api.nomis.cc/api/users/claim-farm",json=json_data, proxy = self.proxy)
124 | logger.success(f"NOMIS | claim_farm | Thread {self.thread} | {self.name} | Claimed farm ")
125 | return await response.json()
126 |
127 | async def start_farm(self):
128 | json_data = {}
129 | response = await self.session.post("https://cms-api.nomis.cc/api/users/start-farm",json=json_data,headers=self.session.headers, proxy = self.proxy)
130 | logger.success(f"NOMIS | start_farm | Thread {self.thread} | {self.name} | Start Farm")
131 | return await response.json()
132 |
133 | async def auth(self):
134 | json_data = {
135 | 'telegram_user_id': self.telegram_user_id,
136 | 'telegram_username': self.telegram_username,
137 | 'referrer': self.referrer[4:],
138 | }
139 | response = await self.session.post('https://cms-api.nomis.cc/api/users/auth',json=json_data,proxy=self.proxy)
140 | self.user_id = (await response.json())['id']
141 | return await response.json()
142 |
143 | async def get_tg_web_data(self):
144 | async with self.client:
145 | try:
146 | bot = await self.client.resolve_peer('NomisAppBot')
147 | app = InputBotAppShortName(bot_id=bot, short_name="app")
148 |
149 |
150 | web_view = await self.client.invoke(RequestAppWebView(
151 | peer=bot,
152 | app=app,
153 | platform='android',
154 | write_allowed=True,
155 | start_param=config.REFERRAL_CODE,
156 | ))
157 |
158 | auth_url = web_view.url
159 | authData = unquote(string=auth_url.split('tgWebAppData=')[1].split('&tgWebAppVersion')[0])
160 | self.telegram_user_id = str((json.loads(parse_qs(unquote(authData))['user'][0])['id']))
161 | self.telegram_username = (json.loads(parse_qs(unquote(authData))['user'][0])['username'])
162 | self.referrer = parse_qs(unquote(authData))['start_param'][0]
163 | self.session.headers['x-app-init-data'] = (unquote(string=auth_url.split('tgWebAppData=')[1].split('&tgWebAppVersion')[0]))
164 | return True
165 | except Exception as err:
166 | logger.error(f"NOMIS | get_tg_webdata | Thread {self.thread} | {self.name} | {err}")
167 | if 'USER_DEACTIVATED_BAN' in str(err):
168 | logger.error(f"NOMIS | get_tg_webdata | Thread {self.thread} | {self.name} | USER BANNED")
169 | return False
170 |
171 | def convert_to_timestamp(self,date_str):
172 | dt = datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%S.%fZ")
173 | timestamp = int(time.mktime(dt.timetuple()) * 1000 + config.UTC*60*1000)
174 | return timestamp
175 |
--------------------------------------------------------------------------------