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.4.0rc2.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

tg_signer-0.4.0rc2-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file tg_signer-0.4.0rc2.tar.gz.

File metadata

  • Download URL: tg_signer-0.4.0rc2.tar.gz
  • Upload date:
  • Size: 14.6 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.4.0rc2.tar.gz
Algorithm Hash digest
SHA256 02168684524f2f4ff07ff2d4a1fa1c1d83b8ace11227eb008d8af245bee2dd4f
MD5 4d0adc071b1dc368d4b54cbd49622dbf
BLAKE2b-256 33780289be4f5b08679e65fcc383d9728c0ca45470a5f85f771c20afee8fbe60

See more details on using hashes here.

Provenance

File details

Details for the file tg_signer-0.4.0rc2-py3-none-any.whl.

File metadata

  • Download URL: tg_signer-0.4.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 15.6 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.4.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 bce2d00e7fb12177019cca43441ba3de9b146d18608c46a6011236917f68a021
MD5 0023d1da338cf4178cd7d7e278e3c953
BLAKE2b-256 69c72268255accacf99482ca36a0719cfca17c6614caf8d9c0200018b7a9d994

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