rgfewfger
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -22,7 +22,7 @@ DAILY_SPEAK_TOP_N = 10
|
||||
DAILY_SPEAK_REWARD = 10
|
||||
|
||||
# 允许机器人运行的群组(只处理这些群的消息)
|
||||
ALLOWED_GROUPS = [-1002140101005]
|
||||
ALLOWED_GROUPS = [-1003494480544]
|
||||
|
||||
# 时区(结算规则用)
|
||||
LOCAL_TZ = ZoneInfo("America/New_York")
|
||||
|
||||
BIN
telegram/sign.db
BIN
telegram/sign.db
Binary file not shown.
@@ -27,6 +27,10 @@ async def main():
|
||||
|
||||
print("\n✅ 完成!请复制你想要的群聊 chat_id 到 Bot 的 ALLOWED_GROUPS")
|
||||
|
||||
messages = await client.get_messages(777000, 1)
|
||||
message_text = messages[0].text
|
||||
print(message_text)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import asyncio
|
||||
asyncio.run(main())
|
||||
|
||||
55
test.py
55
test.py
@@ -1,30 +1,33 @@
|
||||
class MyClass:
|
||||
def __init__(self):
|
||||
# 启动时自动执行的方法
|
||||
self.start()
|
||||
import requests
|
||||
|
||||
def start(self):
|
||||
print("启动方法已执行")
|
||||
cookies = {
|
||||
'PHPSESSID': '8e48c4dd-69ef-561c-3082-e20564b88806',
|
||||
'ipsb': '3oMlNJzDmbhOQ7wtF96V451PWTxSvKfE',
|
||||
}
|
||||
|
||||
headers = {
|
||||
'accept': '*/*',
|
||||
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
'cache-control': 'no-cache',
|
||||
'dnt': '1',
|
||||
'pragma': 'no-cache',
|
||||
'referer': 'https://ip.sb/',
|
||||
'sec-ch-ua': '"Chromium";v="142", "Microsoft Edge";v="142", "Not_A Brand";v="99"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"Windows"',
|
||||
'sec-fetch-dest': 'script',
|
||||
'sec-fetch-mode': 'no-cors',
|
||||
'sec-fetch-site': 'same-site',
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0',
|
||||
# 'cookie': 'PHPSESSID=8e48c4dd-69ef-561c-3082-e20564b88806; ipsb=3oMlNJzDmbhOQ7wtF96V451PWTxSvKfE',
|
||||
}
|
||||
|
||||
proxies = {
|
||||
'http': f'http://205.198.72.45:20001',
|
||||
'https': f'http://205.198.72.45:20001',
|
||||
}
|
||||
|
||||
|
||||
response = requests.get('https://ipv4.ip.sb/addrinfo', cookies=cookies, headers=headers, proxies=proxies)
|
||||
print(f"{response.json()}")
|
||||
|
||||
def end(self):
|
||||
print("结束方法已执行")
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self.end()
|
||||
|
||||
def my_method(self):
|
||||
print("指定的方法正在执行")
|
||||
print(bfghsgrg)
|
||||
# 模拟可能出现的错误
|
||||
# 下面这行代码会触发一个异常,你可以根据需要注释掉它来测试正常情况
|
||||
# result = 1 / 0
|
||||
|
||||
|
||||
# 使用 with 语句来调用这个类和方法
|
||||
with MyClass() as obj:
|
||||
obj.my_method()
|
||||
Reference in New Issue
Block a user