1
0
mirror of https://github.com/Oreomeow/VIP.git synced 2026-02-03 18:43:22 +08:00
Files
vip/Scripts/py/jdcar.py
sourcery-ai[bot] 6f437ddef5 ♻️ 'Refactored by Sourcery' (#14)
Co-authored-by: Sourcery AI <>
2022-10-08 14:43:43 +08:00

71 lines
2.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""
pip3 install telethon pysocks httpx
"""
import os
import time
from telethon import TelegramClient, events, sync
api_id_list = [
"xxxxxxx",
"xxxxxxx",
] # 输入api_id一个账号一项
api_hash_list = [
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
] # 输入api_hash一个账号一项
# 东东工厂
jdfactory = os.environ.get("jdfactory")
# 京喜工厂
jxfactory = os.environ.get("jxfactory")
# 东东萌宠
jdpet = os.environ.get("jdpet")
# 种豆得豆
jdplantbean = os.environ.get("jdplantbean")
# 东东农场
jdfruit = os.environ.get("jdfruit")
# 签到领现金
jdcash = os.environ.get("jdcash")
# 闪购盲盒
jdsgmh = os.environ.get("jdsgmh")
# 东东健康
jdhealth = os.environ.get("jdhealth")
for num in range(len(api_id_list)):
session_name = [f"id_{str(i)}" for i in api_id_list]
client = TelegramClient(session_name[num], api_id_list[num], api_hash_list[num])
client.start()
# 第一项是机器人ID第二项是发送的文字
# 种豆得豆
if jdplantbean is not None:
client.send_message("@BotFather", f"/bean {jdplantbean}")
# 东东农场
if jdfruit is not None:
client.send_message("@BotFather", f"/farm {jdfruit}")
# 京喜工厂
if jxfactory is not None:
client.send_message("@BotFather", f"/jxfactory {jxfactory}")
# 闪购盲盒
if jdsgmh is not None:
client.send_message("@BotFather", f"/sgmh {jdsgmh}")
# 东东工厂
if jdfactory is not None:
client.send_message("@BotFather", f"/ddfactory {jdfactory}")
# 东东萌宠
if jdpet is not None:
client.send_message("@BotFather", f"/pet {jdpet}")
# 东东健康
if jdhealth is not None:
client.send_message("@BotFather", f"/health {jdhealth}")
time.sleep(5) # 延时5秒等待机器人回应一般是秒回应但也有发生阻塞的可能
client.send_read_acknowledge("@BotFather") # 将机器人回应设为已读
print("Done! Session name:", session_name[num])
os._exit(0)