Skip to content
/ budva43 Public

Telegram-Forwarder (UNIX-way) - forwards (or copies) messages from monitored channels and groups to target ones according to specified rules to obtain thematic digests

License

Notifications You must be signed in to change notification settings

comerc/budva43

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

budva43

Go Version Go Report Card codecov Last Commit Project Status

Telegram-Forwarder (UNIX-way) - forwards (or copies) messages from monitored channels and groups to target ones according to specified rules to obtain thematic digests.

How to clone project with submodules

$ git clone https://github.com/comerc/budva43.git
$ git submodule init
$ git submodule update

How to Dev Start

Direct install TDLib on host machine for best dev experience or use DevContainer (some restrictions) for build on Ubuntu.

With direct TDLib

Install by instruction with this options:

  • Install built TDLib to /usr/local instead of placing the files to td/tdlib.
  • Choose which compiler you want to use to build TDLib: clang (recommended)

With DevContainer

only first time:

$ docker-compose build

...then "Reopen in Container"

Install Mockery V2

$ go install github.com/vektra/mockery/v2@v2.53.3

Applied Technologies

.env

Register an application to obtain an api_id and api_hash

# ./config/.private/.env

BUDVA43__TELEGRAM__API_ID=1234567
BUDVA43__TELEGRAM__API_HASH=XXXXXXX
BUDVA43__TELEGRAM__PHONE_NUMBER=+78901234567

Config example

./config/app.yml
./config/engine.yml

First start for Telegram auth

$ make run

Examples for go-tdlib

// How to add InlineKeyboardButton

	row := make([]*client.InlineKeyboardButton, 0)
	row = append(row, &client.InlineKeyboardButton{
		Text: "123",
		Type: &client.InlineKeyboardButtonTypeUrl{
			Url: "https://google.com",
		},
	})
	rows := make([][]*client.InlineKeyboardButton, 0)
	rows = append(rows, row)
	_, err := tdlibClient.SendMessage(&client.SendMessageRequest{
		ChatId: dstChatId,
		InputMessageContent: &client.InputMessageText{
			Text:                  formattedText,
			DisableWebPagePreview: true,
			ClearDraft:            true,
		},
		ReplyMarkup: &client.ReplyMarkupInlineKeyboard{
			Rows: rows,
		},
	})

Inspired by

Filters Mode for Forward...

Exclude #COIN
Include #TSLA

case #COIN
Check +
Other -
To -

case #TSLA
Check -
Other -
To +

case #ARK
Check -
Other +
To -

Test-plan for Config...

  • Text
    • Forward.SendCopy (or forward)
    • and edit sync for double copy
    • Forward.CopyOnce (edit sync)
    • Forward.Indelible (delete sync)
    • Filters Mode (see above)
    • Forward.IncludeSubmatch
    • ReplaceMyselfLinks + DeleteExternal
    • ReplaceFragments (and not equal len)
    • Sources.Link + Title
    • Sources.Sign
    • AutoAnswers
  • MediaAlbum
    • Forward.SendCopy (or forward)
    • Forward.CopyOnce (edit sync)
    • Forward.Indelible (delete sync)

Dependencies

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/cucumber/godog/cmd/godog@latest

About

Telegram-Forwarder (UNIX-way) - forwards (or copies) messages from monitored channels and groups to target ones according to specified rules to obtain thematic digests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages