telegram 的 golang 客户端。可api,可定时发送消息。

Overview

使用说明

此项目主要用于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

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

You might also like...
Simple Telegram Service Bot For Golang

Simple Telegram Service Bot Features Delete and ban channel messages Delete and

RaspChecker - A Telegram bot that allows you to monitor your Raspberry Pi's temperature and shut it down. Written in Golang.

RaspChecker Remotely monitor your Raspberry Pi's temperature and shut it down if you want. All through Telegram. How to set up In order to run the bot

Telegram bot written in Golang using gotgbot library

go_tgbot Telegram bot written in Golang using gotgbot library. How to run go get -u github.com/itsLuuke/go_tgbot rename sample.env to .env and fill in

Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)
Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)

Telego • Go Telegram Bot API Telego is Telegram Bot API library for Golang with full API implementation (one-to-one) The goal of this library was to c

IRC, Slack, Telegram and RocketChat bot written in go
IRC, Slack, Telegram and RocketChat bot written in go

go-bot IRC, Slack & Telegram bot written in Go using go-ircevent for IRC connectivity, nlopes/slack for Slack and Syfaro/telegram-bot-api for Telegram

Telegram Bot Framework for Go

Margelet Telegram Bot Framework for Go is based on telegram-bot-api It uses Redis to store it's states, configs and so on. Any low-level interactions

Client lib for Telegram bot api

Micha Client lib for Telegram bot api. Supports Bot API v2.3.1 (of 4th Dec 2016). Simple echo bot example: package main import ( "log" "git

Go library for Telegram Bot API
Go library for Telegram Bot API

tbot - Telegram Bot Server Features Full Telegram Bot API 4.7 support Zero dependency Type-safe API client with functional options Capture messages by

Telebot is a Telegram bot framework in Go.

Telebot "I never knew creating Telegram bots could be so sexy!" go get -u gopkg.in/tucnak/telebot.v2 Overview Getting Started Poller Commands Files Se

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

    新注册的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 版本仍然可以使用现有帐户和二维码登录)。

    大佬能更新吗?

    opened by Kaystar 6
  • 调用api被拒绝

    调用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"}}

    opened by aston314 0
Owner
scjtqs
scjtqs
Dlercloud-telegram-bot - A Telegram bot for managing your Dler Cloud account

Dler Cloud Telegram Bot A Telegram bot for managing your Dler Cloud account. Usa

Beta Kuang 1 Dec 30, 2021
Pro-bot - A telegram bot to play around with the community telegram channels

pro-bot ?? Pro Bot A Telegram Bot to Play Around With The Community Telegram Cha

TechProber 1 Jan 24, 2022
Golang telegram bot API wrapper, session-based router and middleware

go-tgbot Pure Golang telegram bot API wrapper generated from swagger definition, session-based routing and middlewares. Usage benefits No need to lear

Oleg Lebedev 118 Nov 16, 2022
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

null 4.1k Nov 23, 2022
Golang Based Account Generator Telegram Bot

Account Generator Bot Account Generator Bot, written in GoLang via gotgbot library. Variables Env Vars - BOT_TOKEN - Get it from @BotFather CHANNEL_ID

Anonymous Indian 37 Nov 21, 2022
Library for working with golang telegram client + bot based on tdlib. This library was taken from the user Arman92 and changed for the current version of tdlib.

go-tdlib Golang Telegram TdLib JSON bindings Install To install, you need to run inside a docker container (it is given below) go get -u github.com/ka

Rostislav Krivets 22 Oct 30, 2022
A bot based on Telegram Bot API written in Golang allows users to download public Instagram photos, videos, and albums without receiving the user's credentials.

InstagramRobot InstagramRobot is a bot based on Telegram Bot API written in Golang that allows users to download public Instagram photos, videos, and

FTC Team 8 Dec 16, 2021
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

null 0 Nov 18, 2021
Crypto Telegram Bot For Golang

BITCOIN-TELEGRAM-BOT Table of Contents Getting Started What you will need Installation Add BTB to your Telegram Channel Usage Getting started What you

Matias I 1 Jun 6, 2022
A telegram bot to ban the chat spammers by channel, made with Golang.

ChannelBot A telegram bot to ban channels spamming chat. Vars TOKEN - Your Telegram Bot Token (@BotFather) More Information With the latest update of

Reeshu 5 Nov 8, 2022