mirror of
https://github.com/father-bot/chatgpt_telegram_bot.git
synced 2026-06-13 12:04:57 +03:00
17 lines
447 B
Python
17 lines
447 B
Python
import time
|
|
|
|
from telegram.ext import CallbackContext
|
|
from telegram import Update
|
|
|
|
from chatgpt import ChatGPT
|
|
import config
|
|
|
|
|
|
def init_user(update: Update, context: CallbackContext):
|
|
# init chatgpt
|
|
if "chatgpt" not in context.user_data:
|
|
context.user_data["chatgpt"] = ChatGPT(chat_mode="assistant")
|
|
|
|
if "last_interation_timestamp" not in context.user_data:
|
|
context.user_data["last_interation_timestamp"] = time.time()
|