-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use MySQL database and ENV variables
Fixes #4
- Loading branch information
Showing
15 changed files
with
849 additions
and
123 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BOT_TOKEN=123456789:abcdefghijklmnopqrstuvxwyz | ||
MYSQL_URL=user:password@tcp(127.0.0.1:3306)/database_name?charset=utf8mb4&parseTime=True&loc=Local |
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,3 +1,3 @@ | ||
.idea | ||
dist/ | ||
config.json | ||
.env |
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
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 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 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 |
---|---|---|
|
@@ -6,6 +6,6 @@ import ( | |
) | ||
|
||
type Handler struct { | ||
Bot *telebot.Bot | ||
Config *storage.Config | ||
Bot *telebot.Bot | ||
DB *storage.DB | ||
} |
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 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 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 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 @@ | ||
-- +migrate Up | ||
|
||
CREATE TABLE IF NOT EXISTS `subscribers` | ||
( | ||
`id` bigint(20) NOT NULL, | ||
`created_at` datetime NOT NULL DEFAULT current_timestamp(), | ||
PRIMARY KEY (`id`) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4; | ||
|
||
CREATE TABLE IF NOT EXISTS `system` | ||
( | ||
`key` VARCHAR(20) NOT NULL, | ||
`value` VARCHAR(255) NOT NULL, | ||
PRIMARY KEY (`key`) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4; | ||
|
||
INSERT INTO `system` (`key`, `value`) | ||
VALUES ('last_entry', ''); |
Oops, something went wrong.