bitmart优化完成
This commit is contained in:
48
bit_tools.py
48
bit_tools.py
@@ -210,27 +210,27 @@ if __name__ == '__main__':
|
|||||||
# proxyPassword=ips_info.password
|
# proxyPassword=ips_info.password
|
||||||
# )
|
# )
|
||||||
|
|
||||||
fz_datas = get_group_lists()
|
# fz_datas = get_group_lists()
|
||||||
# fz_datas['推特']
|
# # fz_datas['推特']
|
||||||
|
#
|
||||||
for i in range(10):
|
# for i in range(10):
|
||||||
for i in get_browser_lists_Browser(id=fz_datas['推特'], page=i):
|
# for i in get_browser_lists_Browser(id=fz_datas['推特'], page=i):
|
||||||
x_start_info = Xstart.get_or_none(
|
# x_start_info = Xstart.get_or_none(
|
||||||
Xstart.bit_id == i["id"]
|
# Xstart.bit_id == i["id"]
|
||||||
)
|
# )
|
||||||
|
#
|
||||||
if not x_start_info:
|
# if not x_start_info:
|
||||||
deleteBrowser(id=i["id"])
|
# deleteBrowser(id=i["id"])
|
||||||
|
#
|
||||||
continue
|
# continue
|
||||||
|
#
|
||||||
if x_start_info.start:
|
# if x_start_info.start:
|
||||||
continue
|
# continue
|
||||||
|
#
|
||||||
deleteBrowser(id=i["id"])
|
# deleteBrowser(id=i["id"])
|
||||||
|
#
|
||||||
x_start_info.bit_id = None
|
# x_start_info.bit_id = None
|
||||||
x_start_info.save()
|
# x_start_info.save()
|
||||||
|
|
||||||
# for i in Xstart.select():
|
# for i in Xstart.select():
|
||||||
# res = browser_detail(id=i.bit_id)
|
# res = browser_detail(id=i.bit_id)
|
||||||
@@ -242,9 +242,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# print(browser_detail(id="532651f5330e4caa917e644f9b676b"))
|
# print(browser_detail(id="532651f5330e4caa917e644f9b676b"))
|
||||||
|
|
||||||
# # 批量修改代理
|
# 批量修改代理
|
||||||
# for i in Xstart.select().where(Xstart.start == 0):
|
for i in Xstart.select().where(Xstart.start == 1):
|
||||||
# update_proxy_Browser(id=i.bit_id, proxyType="http", host="104.168.59.92", port=random.randint(20001, 25000), )
|
update_proxy_Browser(id=i.bit_id, proxyType="http", host="127.0.0.1", port=random.randint(42000, 42089), )
|
||||||
|
|
||||||
# fz_datas = get_group_lists()
|
# fz_datas = get_group_lists()
|
||||||
# print(fz_datas)
|
# print(fz_datas)
|
||||||
|
|||||||
Binary file not shown.
BIN
telegram/bhaha_session.session
Normal file
BIN
telegram/bhaha_session.session
Normal file
Binary file not shown.
Binary file not shown.
@@ -12,8 +12,8 @@ from telethon.tl.types import BotCommand, BotCommandScopeDefault
|
|||||||
# ========== 配置区 ==========
|
# ========== 配置区 ==========
|
||||||
API_ID = 2040 # 请填入您的 API ID
|
API_ID = 2040 # 请填入您的 API ID
|
||||||
API_HASH = "b18441a1ff607e10a989891a5462e627" # 请填入您的 API HASH
|
API_HASH = "b18441a1ff607e10a989891a5462e627" # 请填入您的 API HASH
|
||||||
BOT_TOKEN = "8451724418:AAGTGqCmc1JiUr88IABhMiQTHeVLcAcnT5Y" # 请填入您的 Bot Token
|
BOT_TOKEN = "7851888372:AAGV565t4kjOfVihSYbGbu3gyK5uLADjlbs" # 请填入您的 Bot Token
|
||||||
DB_PATH = "sign.db"
|
DB_PATH = "sign1.db"
|
||||||
|
|
||||||
# 积分配置
|
# 积分配置
|
||||||
SIGN_POINTS = 10
|
SIGN_POINTS = 10
|
||||||
@@ -23,7 +23,7 @@ DAILY_SPEAK_REWARD = 10
|
|||||||
|
|
||||||
# 允许机器人运行的群组(只处理这些群的消息)
|
# 允许机器人运行的群组(只处理这些群的消息)
|
||||||
# 请填入您的群组 ID,例如:[-1003494480544]
|
# 请填入您的群组 ID,例如:[-1003494480544]
|
||||||
ALLOWED_GROUPS = [-1003494480544]
|
ALLOWED_GROUPS = [-1002019834357]
|
||||||
|
|
||||||
# 时区(结算规则用)
|
# 时区(结算规则用)
|
||||||
LOCAL_TZ = ZoneInfo("America/New_York")
|
LOCAL_TZ = ZoneInfo("America/New_York")
|
||||||
@@ -643,7 +643,7 @@ async def send_price_periodically(bot, chat_id):
|
|||||||
print(f"[price] Failed to send price update: {e}")
|
print(f"[price] Failed to send price update: {e}")
|
||||||
# 等待下一小时整点(保持每小时推送一次)
|
# 等待下一小时整点(保持每小时推送一次)
|
||||||
now = datetime.datetime.now(LOCAL_TZ)
|
now = datetime.datetime.now(LOCAL_TZ)
|
||||||
next_hour = (now.replace(minute=0, second=0, microsecond=0) + datetime.timedelta(hours=2))
|
next_hour = (now.replace(minute=0, second=0, microsecond=0) + datetime.timedelta(hours=6))
|
||||||
wait_seconds = (next_hour - now).total_seconds()
|
wait_seconds = (next_hour - now).total_seconds()
|
||||||
await asyncio.sleep(wait_seconds)
|
await asyncio.sleep(wait_seconds)
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ async def main():
|
|||||||
|
|
||||||
# 使用代理时传 proxy=PROXY,若不需要代理则移除该参数
|
# 使用代理时传 proxy=PROXY,若不需要代理则移除该参数
|
||||||
# Telethon proxy 格式可能和你的代理不同,请按需调整(或移除)
|
# Telethon proxy 格式可能和你的代理不同,请按需调整(或移除)
|
||||||
bot = TelegramClient('bot_session', API_ID, API_HASH, proxy=PROXY)
|
bot = TelegramClient('bhaha_session', API_ID, API_HASH, proxy=PROXY)
|
||||||
await bot.start(bot_token=BOT_TOKEN)
|
await bot.start(bot_token=BOT_TOKEN)
|
||||||
|
|
||||||
# 设置 Bot Commands(让用户可以通过命令菜单选择命令,避免自动添加 @botname)
|
# 设置 Bot Commands(让用户可以通过命令菜单选择命令,避免自动添加 @botname)
|
||||||
|
|||||||
BIN
telegram/sign.db
BIN
telegram/sign.db
Binary file not shown.
BIN
telegram/sign1.db
Normal file
BIN
telegram/sign1.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user