Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Telegram platform #45

Merged
merged 5 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type DBConfig struct {

type PlatformConfig struct {
Twitter TwitterPlatformConfig `json:"twitter"`
Telegram TelegramPlatformConfig `json:"telegram"`
Ethereum EthereumPlatformConfig `json:"ethereum"`
Discord DiscordPlatformConfig `json:"discord"`
}
Expand All @@ -49,6 +50,12 @@ type TwitterPlatformConfig struct {
ConsumerSecret string `json:"consumer_secret"`
}

type TelegramPlatformConfig struct {
ApiID int `json:"api_id"`
ApiHash string `json:"api_hash"`
BotToken string `json:"bot_token"`
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we need to specify the "public channel ID" for bot to forward proof post to?

Copy link
Contributor Author

@hhio618 hhio618 Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do it using any public channel where the bot is a member!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, you mean a public group (instead of a public channel)?

This is a "channel": everyone can subscribe and read, but only admin can post contents

image


type EthereumPlatformConfig struct {
RPCServer string `json:"rpc_server"`
}
Expand Down
38 changes: 25 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/gagliardetto/solana-go v1.4.0
github.com/gin-gonic/gin v1.7.7
github.com/go-resty/resty/v2 v2.7.0
github.com/gotd/td v0.71.0
github.com/mr-tron/base58 v1.2.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/viper v1.11.0
Expand Down Expand Up @@ -46,6 +47,9 @@ require (
github.com/gagliardetto/binary v0.6.1 // indirect
github.com/gagliardetto/treeout v0.1.4 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-faster/errors v0.6.1 // indirect
github.com/go-faster/jx v0.40.0 // indirect
github.com/go-faster/xor v0.3.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.1 // indirect
Expand All @@ -55,6 +59,8 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gotd/ige v0.2.2 // indirect
github.com/gotd/neo v0.1.5 // indirect
github.com/hamba/avro v1.5.6 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac // indirect
Expand All @@ -69,12 +75,12 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/compress v1.15.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -83,6 +89,7 @@ require (
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
Expand All @@ -95,19 +102,24 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect
golang.org/x/exp v0.0.0-20220921164117-439092de6870 // indirect
golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
go.opentelemetry.io/otel v1.11.1 // indirect
go.opentelemetry.io/otel/trace v1.11.1 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/exp v0.0.0-20221002003631-540bb7301a08 // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/mysql v1.3.3 // indirect
nhooyr.io/websocket v1.8.7 // indirect
rsc.io/qr v0.2.0 // indirect
)

require (
Expand All @@ -119,8 +131,8 @@ require (
github.com/google/go-github/v41 v41.0.0
github.com/google/uuid v1.3.0
github.com/samber/lo v1.28.2
github.com/stretchr/testify v1.7.2
golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25 // indirect
github.com/stretchr/testify v1.8.1
golang.org/x/sys v0.1.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
gorm.io/datatypes v1.0.6
gorm.io/driver/postgres v1.3.5
Expand Down
Loading