-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix some missing data from Steam Signed-off-by: Eiko Wagenknecht <[email protected]> * Add telegram bot functionality Signed-off-by: Eiko Wagenknecht <[email protected]> * Telegram menu Signed-off-by: Eiko Wagenknecht <[email protected]> * Manage menu Signed-off-by: Eiko Wagenknecht <[email protected]> * Send new offers method Signed-off-by: Eiko Wagenknecht <[email protected]> * Bot only when configured Signed-off-by: Eiko Wagenknecht <[email protected]> * Enable details button and subscriptions Signed-off-by: Eiko Wagenknecht <[email protected]> * Count offers sent Signed-off-by: Eiko Wagenknecht <[email protected]> * No Steam refresh every time Signed-off-by: Eiko Wagenknecht <[email protected]> * More send new offers text Signed-off-by: Eiko Wagenknecht <[email protected]> * Readme Signed-off-by: Eiko Wagenknecht <[email protected]> * Better error handling Signed-off-by: Eiko Wagenknecht <[email protected]>
- Loading branch information
1 parent
0e29ae6
commit b4277dc
Showing
15 changed files
with
1,095 additions
and
314 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
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,51 @@ | ||
"""User table | ||
Revision ID: 8cfaaf08b306 | ||
Revises: 038c26b62555 | ||
Create Date: 2022-04-20 14:42:19.402926+00:00 | ||
""" | ||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
from app.sqlalchemy import AwareDateTime | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "8cfaaf08b306" | ||
down_revision = "038c26b62555" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.create_table( | ||
"users", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("registration_date", AwareDateTime(), nullable=True), | ||
sa.Column("offers_received_count", sa.Integer(), nullable=True), | ||
sa.Column("telegram_id", sa.Integer(), nullable=True), | ||
sa.Column("telegram_chat_id", sa.Integer(), nullable=True), | ||
sa.Column("telegram_user_details", sa.JSON(), nullable=True), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.create_table( | ||
"telegram_subscriptions", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("user_id", sa.Integer(), nullable=False), | ||
sa.Column( | ||
"source", | ||
sa.Enum("AMAZON", "EPIC", "STEAM", "GOG", name="source"), | ||
nullable=False, | ||
), | ||
sa.Column("type", sa.Enum("LOOT", "GAME", name="offertype"), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["user_id"], | ||
["users.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_table("telegram_subscriptions") | ||
op.drop_table("users") |
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,45 @@ | ||
"""Last sent offer | ||
Revision ID: 52ea632ee417 | ||
Revises: 8cfaaf08b306 | ||
Create Date: 2022-04-22 09:05:29.092417+00:00 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "52ea632ee417" | ||
down_revision = "8cfaaf08b306" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("offers", schema=None) as batch_op: # type: ignore | ||
batch_op.alter_column("seen_first", existing_type=sa.DATETIME(), nullable=False) | ||
batch_op.alter_column("seen_last", existing_type=sa.DATETIME(), nullable=False) | ||
|
||
with op.batch_alter_table( # type: ignore | ||
"telegram_subscriptions", schema=None | ||
) as batch_op: | ||
batch_op.add_column(sa.Column("last_offer_id", sa.Integer(), nullable=True)) | ||
|
||
op.execute("UPDATE telegram_subscriptions SET last_offer_id = 0") | ||
|
||
with op.batch_alter_table( # type: ignore | ||
"telegram_subscriptions", schema=None | ||
) as batch_op: | ||
batch_op.alter_column( | ||
"last_offer_id", existing_type=sa.Integer(), nullable=False | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
with op.batch_alter_table("telegram_subscriptions", schema=None) as batch_op: # type: ignore | ||
batch_op.drop_column("last_offer_id") | ||
|
||
with op.batch_alter_table("offers", schema=None) as batch_op: # type: ignore | ||
batch_op.alter_column("seen_last", existing_type=sa.DATETIME(), nullable=True) | ||
batch_op.alter_column("seen_first", existing_type=sa.DATETIME(), nullable=True) |
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
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
Oops, something went wrong.