Code Monkey home page Code Monkey logo

go-tg-tdlib's Introduction

使用说明

此项目主要用于tg自己账号登录 定时发送消息给某人

当前容器支持 amd64、i386、arm64、armhf

特别说明!!! tg的验证码不是发的手机短信,是发送到了tg客户端上!!!!国内手机号需要加上+86!!

首次使用需要进行登录

需要使用docker run进行登录处理

docker run -it --rm --name tg_cli \
-v `pwd`:/home \
-e AppID="1807909" \
-e AppHash="4b1594bcfab16b370686b14d85c60559" \
-e ProxyStatus="true" \
-e ProxyType="Socks5" \
-e ProxyAddr="192.168.0.111" \
-e ProxyPort="7890" \
-e ProxyUser="" \
-e ProxyPasswd="" \
scjtqs/go-tg:latest

AppID 可不填

AppHash 可不填

ProxyStatus 是否开启 网络代理,默认为 "false"

ProxyType 支持Socks5HTTPHTTPSMtProto

ProxyPasswd 如果是MtProto 这里填secret

ProxyAddr 这个别填 localhost和 127.0.0.1。否则会识别成docker容器内部,而非宿主机

国内阿里云镜像 registry.cn-hangzhou.aliyuncs.com/scjtqs/go-tg:latest

其他 环境变量,请查看 Dockerfile.go-td 里面的 ENV部分

WebApiStatus 是否开启api,默认为 "false"。要开启请填 "true"

WebApiPort api监听端口,默认"9001"

WebApiToken api鉴权token,默认 "abcde"

定时任务配置

首次运行后,当前目录会生成一个cron.json目录

{
	"cron_config": [
		{
			"cron": "* * * * *",
			"to_user_name": "@LvanLamCommitCodeBot",
			"text_msg": "/start"
		},
		{
			"cron": "* * * * *",
			"to_user_name": "@TuringLabbot",
			"text_msg": "/start"
		}
	]
}

cron 是定时配置,参考linux的crontab,5个参数为分钟即,6个参数为秒级

to_user_name 是对方的username

text_msg 是要发送的消息类容

请自行修改

cron薅羊毛参考 1,2,3,4,5 0 1,8,16,24 * ?

docker后台运行

docker run  -d --restart=always --name tg_bot \
-v /yourdir:/home \
-e ProxyStatus="true" \
-e ProxyType="Socks5" \
-e ProxyAddr="192.168.0.111" \
-e ProxyPort="7890" \
-e ProxyUser="" \
-e ProxyPasswd="" \
scjtqs/go-tg:latest

api 功能

点击查看

使用docker-compose 方式运行

点击查看

for develop

如果我想自己修改代码,要如何编译当前代码

go-tg-tdlib's People

Contributors

scjtqs2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

go-tg-tdlib's Issues

新注册的tg号无法使用手机号和验证码登录了

[ERROR]: Error sending auth code : error! code: %!d(float64=406) msg: UPDATE_APP_TO_LOGIN

如果出现错误码406“UPDATE_APP_TO_LOGIN”,说明TDLib版本已经过时,必须更新到最新的1.7.9版本,原因是Telegram已经迁移到64位标识符,之前的版本不兼容,所以无法使用手机登录(1.7.0 版本仍然可以使用现有帐户和二维码登录)。

大佬能更新吗?

最近报错response catching timeout

[2023-05-22 08:01:00] [ERROR]: faild to check username @CMSPushBot,err:=response catching timeout

[2023-05-22 08:01:00] [ERROR]: send message to username error err:@CMSPushBot

%!(EXTRA *errors.errorString=response catching timeout)

调用api被拒绝

{
"status": "rejected",
"reason": {
"message": "connect ECONNREFUSED 192.168.2.1:9901",
"name": "Error",
"stack": "Error: connect ECONNREFUSED 192.168.2.1:9901 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)",
"code": "ECONNREFUSED"
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.