-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45c86aa
commit 7400db1
Showing
43 changed files
with
94 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
*.env | ||
*.log | ||
*.rdb | ||
*.pyc | ||
*.sum | ||
*.lock | ||
*.session | ||
*.session-journal | ||
|
||
.codesandbox | ||
.devcontainer | ||
|
||
|
||
|
||
.devcontainer | ||
.devcontainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"golang.go" | ||
"golang.go", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module github.com/SantiiRepair/kreacher-bot | ||
|
||
go 1.21.5 | ||
|
||
require ( | ||
github.com/cespare/xxhash/v2 v2.2.0 // indirect | ||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect | ||
github.com/joho/godotenv v1.5.1 // indirect | ||
github.com/redis/go-redis/v9 v9.3.1 // indirect | ||
gopkg.in/telebot.v3 v3.2.1 // indirect | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package kreacher | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/redis/go-redis/v9" | ||
tele "gopkg.in/telebot.v3" | ||
) | ||
|
||
var rdb = redis.NewClient(&redis.Options{ | ||
Addr: "localhost:6379", | ||
Password: "", // no password set | ||
DB: 0, // use default DB | ||
Protocol: 3, // specify 2 for RESP 2 or 3 for RESP 3 | ||
}) | ||
|
||
var kbot, _ = tele.NewBot(tele.Settings{ | ||
Token: NewConfig().BotToken, | ||
Poller: &tele.LongPoller{Timeout: 10 * time.Second}, | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package kreacher | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/joho/godotenv" | ||
) | ||
|
||
type Config struct { | ||
APIID string | ||
APIHash string | ||
BotToken string | ||
BotUsername string | ||
Channel string | ||
ESMoviesChannel string | ||
ESSeriesChannel string | ||
ManagementMode string | ||
Maintainer string | ||
SessionString string | ||
PostgresDB string | ||
PostgresUser string | ||
PostgresPassword string | ||
PostgresHost string | ||
PostgresPort string | ||
RedisHost string | ||
RedisPassword string | ||
RedisPort string | ||
} | ||
|
||
func NewConfig() *Config { | ||
err := godotenv.Load("../.env") | ||
if err != nil { | ||
fmt.Println("No .env file found") | ||
} | ||
|
||
return &Config{ | ||
APIID: os.Getenv("API_ID"), | ||
APIHash: os.Getenv("API_HASH"), | ||
BotToken: os.Getenv("BOT_TOKEN"), | ||
BotUsername: os.Getenv("BOT_USERNAME"), | ||
Channel: os.Getenv("CHANNEL"), | ||
ESMoviesChannel: os.Getenv("ES_MOVIES_CHANNEL"), | ||
ESSeriesChannel: os.Getenv("ES_SERIES_CHANNEL"), | ||
ManagementMode: os.Getenv("MANAGEMENT_MODE"), | ||
Maintainer: os.Getenv("MANTAINER"), | ||
SessionString: os.Getenv("SESSION_STRING"), | ||
PostgresDB: os.Getenv("POSTGRES_DB"), | ||
PostgresUser: os.Getenv("POSTGRES_USER"), | ||
PostgresPassword: os.Getenv("POSTGRES_PASSWORD"), | ||
PostgresHost: os.Getenv("POSTGRES_HOST"), | ||
PostgresPort: os.Getenv("POSTGRES_PORT"), | ||
RedisHost: os.Getenv("REDIS_HOST"), | ||
RedisPassword: os.Getenv("REDIS_PASSWORD"), | ||
RedisPort: os.Getenv("REDIS_PORT"), | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.