BuddyPanda / main.py
rexthecoder's picture
chore: fix data
4f624b9
raw
history blame
1.18 kB
import logging
import os
import sys
import threading
sys.path.insert(0, "src")
os.environ['TRANSFORMERS_CACHE'] = '/tmp'
from telegram.ext import (
Application,
)
from api import GirlfriendGPT
from functools import partial
from typing import List
from telegram import Update
from termcolor import colored
SELECT_COMMAND, GET_TEXT = range(2)
# Enable logging
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO
)
logger = logging.getLogger(__name__)
class LoggingDisabled:
"""Context manager that turns off logging within context."""
def __enter__(self):
logging.disable(logging.CRITICAL)
def __exit__(self, exit_type, exit_value, exit_traceback):
logging.disable(logging.NOTSET)
def main():
app = Application.builder().token(
'5998527257:AAH9cWNMsakaRJNSDW2OucR_Qb1J2noL0Ak',).build()
run_agent(
agent=GirlfriendGPT(
token="hello",
application=app
)
)
print(f"Starting Agent...")
def run_agent(agent: GirlfriendGPT, as_api: bool = False) -> None:
agent.handlers()
if __name__ == "__main__":
main()