ns-bots / tg-file-store Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Bot is working fine but getting an error after some time in Heroku logs.
2022-06-24T03:31:16.798962+00:00 app[worker.1]: During handling of the above exception, another exception occurred:
2022-06-24T03:31:16.798962+00:00 app[worker.1]:
2022-06-24T03:31:16.798962+00:00 app[worker.1]: Traceback (most recent call last):
2022-06-24T03:31:16.798963+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 222, in handler_worker
2022-06-24T03:31:16.798963+00:00 app[worker.1]: await handler.callback(self.client, *args)
2022-06-24T03:31:16.798963+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/pyromod/listen/listen.py", line 93, in resolve_listener
2022-06-24T03:31:16.798964+00:00 app[worker.1]: await self.user_callback(client, message, *args)
2022-06-24T03:31:16.798964+00:00 app[worker.1]: File "/app/plugins/Forcesub.py", line 23, in forcesub
2022-06-24T03:31:16.798965+00:00 app[worker.1]: chat_id, msg_id = decoded_data.split('_')
2022-06-24T03:31:16.798965+00:00 app[worker.1]: ValueError: too many values to unpack (expected 2)
Is it possible to add 4GB support with the help of the session string in the bot
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
import os
import threading
import asyncio
from sqlalchemy import Column, Integer, Boolean, String, ForeignKey, UniqueConstraint, func
DATABASE_URL = os.environ.get("DATABASE_URL", "")
def start() -> scoped_session:
engine = create_engine(DATABASE_URL, client_encoding="utf8")
BASE.metadata.bind = engine
BASE.metadata.create_all(engine)
return scoped_session(sessionmaker(bind=engine, autoflush=False))
BASE = declarative_base()
SESSION = start()
INSERTION_LOCK = threading.RLock()
class Database(BASE):
tablename = "database"
id = Column(String, primary_key=True)
up_name = Column(Boolean)
def __init__(self, id, up_name):
self.id = str(id)
self.up_name = up_name
Database.table.create(checkfirst=True)
async def update_as_name(id, mode):
with INSERTION_LOCK:
msg = SESSION.query(Database).get(str(id))
if not msg:
msg = Database(str(id), False)
else:
msg.up_name = mode
SESSION.delete(msg)
SESSION.add(msg)
SESSION.commit()
async def get_data(id):
try:
user_data = SESSION.query(Database).get(str(id))
if not user_data:
new_user = Database(str(id), False)
SESSION.add(new_user)
SESSION.commit()
user_data = SESSION.query(Database).get(str(id))
return user_data
finally:
SESSION.close()
This repo doesn't work don't waste your time on it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.