Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gino import Gino
- db_pg = Gino()
- class User(db_pg.Model):
- __tablename__ = 'users_bot'
- id = db_pg.Column(db_pg.Integer(), primary_key=True)
- nickname = db_pg.Column(db_pg.Unicode(), default='noname')
- email = db_pg.Column(db_pg.Unicode())
- _meta = db_pg.Column(db_pg.Unicode(), default="none")
- class UserLang(db_pg.Model):
- __tablename__ = 'users_lang'
- id = db_pg.Column(db_pg.Integer(), primary_key=True)
- lang = db_pg.Column(db_pg.Unicode())
- class AccessToken(db_pg.Model):
- __tablename__ = 'access_token_auth'
- chat_id = db_pg.Column(db_pg.Integer())
- token_github = db_pg.Column(db_pg.Unicode(), default='0')
- token_google = db_pg.Column(db_pg.Unicode(), default='0')
- class PastebinTable(db_pg.Model):
- __tablename__ = 'PastebinTable'
- chat_id = db_pg.Column(db_pg.Integer())
- paste = db_pg.Column(db_pg.Unicode())
- async def task():
- await db_pg.set_bind(help.POSTGRES)
- await db_pg.gino.create_all()
- u1 = await pastebin_table.create(chat_id=21, paste="ahjsdg")
- print(u1)
- """
- """
- @dp.message_handler(commands=["make_paste"])
- async def make_paste(message: types.Message) -> Button.buttons:
- # try:
- s = await pastebin_table.create(paste=message.reply_to_message.text, chat_id=message.chat.id)
- print(s)
- return await message.answer(text=lazy_get_text("какой формат?"),
- reply_markup=Button.buttons(text=["pastebin", "jsonbox"],
- call_back=["pastebin",
- "jsonbox"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement