-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
31 lines (25 loc) · 950 Bytes
/
functions.py
File metadata and controls
31 lines (25 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import datetime
from pymongo import MongoClient
from goat_ai import generate_ai_content
from telegram import Bot, InlineKeyboardButton, InlineKeyboardMarkup
import config
bot = Bot(config.BOT_TOKEN)
time_fun = datetime.datetime
mongo_client = MongoClient(config.MONGODB_CONNECTION_STRING)
db = mongo_client["goatdb"]
peoples_col = db["peoples"]
group_col = db["group_col"]
messages_col = db['message_col']
async def menu_button(update, context, text="Choose Options:"):
message = update.message
if message.chat.type == "group" or message.chat.type == "supergroup":
return
keyboard = [
[InlineKeyboardButton("My Project", callback_data="my_project")],
[InlineKeyboardButton("Functionalities", callback_data="functionalities")],
]
await update.message.chat_id(
text=text,
reply_markup=InlineKeyboardMarkup(keyboard),
reply_to_message_id=update.message.message_id,
)