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不读取系统代理,可以使用环境变量 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.0rc1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tg_signer-0.3.0rc1.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.0rc1.tar.gz
Algorithm Hash digest
SHA256 0eb7f3974ba3f3a2ab4efa2b464c298a45421b2e5ed1a0e31828adb2b0fc3ab2
MD5 4e347bb1721e07f75c1959857a955278
BLAKE2b-256 f3e75a9031bed074bf4e4a5d3dd1f509dd51347163b2edf123301245415a63bf

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: tg_signer-0.3.0rc1-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.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 97f735240ca6986efc50c2ed20922bfba290acd93d5f9a461328b1a50b651395
MD5 d7d54586385d2aa505451f4a9c50e9a3
BLAKE2b-256 f22e737164abca78a5681dfc961e408c65672bd971c1c5e6f3f49ed4bb1bcefc

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