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.0b2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tg_signer-0.3.0b2.tar.gz
Algorithm Hash digest
SHA256 c4b525ece64569ce0f911b7c4fc2ab6303c4d4f660ca9b67d7eb6429b9d1ebc3
MD5 b71f978d40a72f64ae3cbda8913cc614
BLAKE2b-256 9d9861051e474154060710bbfd16ffffa2ece6dff0b2cf33123a67a47336040f

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for tg_signer-0.3.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 358ec369b0153b025dcb93226b0560ad74fc229602eb5f8355d53ab68b516687
MD5 3a3ebf67db764d8612cc9d0601343b7d
BLAKE2b-256 f557f5b19c0e152a8a6254c59bf2720eaedf66481fe89eae10b66450369526c4

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