Skip to main content

Telegram signer

Project description

Telegram Signer - Telegram每日自动签到

English

安装

pip install -U tg-signer

或者为了提升程序速度:

pip install "tg-signer[speedup]"

使用方法

Usage: tg-signer [OPTIONS] COMMAND [ARGS]...

  使用<子命令> --help查看使用说明

子命令别名:
  run_once -> run-once
  send_text -> send-text

Options:
  -l, --log-level [debug|info|warn|error]
                                  日志等级, `debug`, `info`, `warn`, `error`
                                  [default: info]
  --log-file PATH                 日志文件路径, 可以是相对路径  [default: tg-signer.log]
  -p, --proxy TEXT                代理地址, 例如: socks5://127.0.0.1:1080,
                                  会覆盖环境变量`TG_PROXY`的值  [env var: TG_PROXY]
  --session_dir PATH              存储TG Sessions的目录, 可以是相对路径  [default: .]
  -a, --account TEXT              自定义账号名称,对应session文件名为<account>.session
                                  [default: my_account]
  -w, --workdir PATH              tg-signer工作目录,用于存储配置和签到记录等  [default:
                                  .signer]
  --help                          Show this message and exit.

Commands:
  list       列出已有配置
  login      登录账号(用于获取session)
  logout     登出账号并删除session文件
  reconfig   重新配置
  run        根据任务配置运行签到
  run-once   运行一次签到任务,即使该签到任务今日已执行过
  send-text  发送一次消息, 请确保当前会话已经"见过"该`chat_id`
  version    Show version

例如:

tg-signer run
tg-signer run my_sign  # 不询问,直接运行'my_sign'任务
tg-signer run-once my_sign  # 直接运行一次'my_sign'任务
tg-signer send-text 8671234001 /test  # 向chat_id为'8671234001'的聊天发送'/test'文本
tg-signer send-text --delete-after 1 8671234001 /test  # 向chat_id为'8671234001'的聊天发送'/test'文本, 并在1秒后删除发送的消息

配置代理(如有需要)

tg-signer不读取系统代理,可以使用环境变量 TG_PROXY或命令参数--proxy进行配置

例如:

export TG_PROXY=socks5://127.0.0.1:7890

登录

tg-signer login

根据提示输入手机号码和验证码进行登录并获取最近的聊天列表,确保你想要签到的聊天在列表内。

运行签到任务

tg-signer run

根据提示进行配置。数据和配置保存在 .signer 目录中。然后运行 tree .signer,你将看到:

.signer
├── latest_chats.json  # 获取的最近对话
├── me.json  # 个人信息
└── signs
    └── openai  # 签到任务名
        ├── config.json  # 签到配置
        └── sign_record.json  # 签到记录

3 directories, 4 files

发送一次消息

tg-signer send-text 8671234001 hello  # 向chat_id为'8671234001'的聊天发送'hello'文本

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tg_signer-0.3.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

tg_signer-0.3.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file tg_signer-0.3.0.tar.gz.

File metadata

  • Download URL: tg_signer-0.3.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for tg_signer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 89dcd98d72bdb722e465de6521385f5f12614fe1b2d4b43ea344920b090de82e
MD5 17b8de304a3ba50ef2a9942f419c7889
BLAKE2b-256 0d7fe9acb2969aff02f74615444b4fe821465d9eb8cae8700e489c07f06057c3

See more details on using hashes here.

Provenance

File details

Details for the file tg_signer-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tg_signer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for tg_signer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17976bca7fe5ee911142ddf591223a00eb80a998c55cf1add1bc94533471b762
MD5 459f40e17c3a183ff29b49aa5fa9f84e
BLAKE2b-256 247b5bc6cda1bb943acd755ff7d94781f9c930ad922edae04c894001a12e5d84

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page