How to Make Request To Chat GPT Using TeleBot ⁉️
🧩 Command:-
🧩 Command:-
/askChatgptApi = """Enter Your Chat GPT ApI"""
hi = libs.Resources.userRes('name').value()
if hi >= 10:
bot.replyText(u,"⛔️You Have Already Done 10 Request")
raise ReturnCommand()
bot.sendChatAction(
chat_id=message.chat.id,
action="typing"
)
bot.sendChatAction(
chat_id=message.chat.id,
action="typing"
)
bot.sendChatAction(
chat_id=message.chat.id,
action="typing"
)
url = "https://api.openai.com/v1/engines/text-davinci-003/completions"
headers = {
"Authorization": f"Bearer {ChatgptApi}",
"Content-Type": "application/json"
}
# Define a function to get OpenAI API response
def get_response(message):
data = {
"prompt": message,
"max_tokens": 50
}
response = bunchify(HTTP.post(url, headers=headers, json=data).json())
response_text = response['choices'][0]['text']
return response_text
# Call the function and reply to the user
response_text = get_response(params)
bot.replyText(u, response_text, reply_to_message_id=message.message_id)
libs.Resources.userRes('name').add(1)
🔥15👏12🤩11👍10🎉10❤9🥰7
All Chat Action In Telegram❗️
🧩 Command:- ChatAction
🧩 Command:- /ChatAction
🧩 Command:- ChatAction
sample_buttons = ['upload_photo', 'typing', 'upload_audio', 'upload_document']
keyboard = []
for i in sample_buttons:
keyboard.append([InlineKeyboardButton(i, callback_data=f"/ChatAction {i}")])
markup = InlineKeyboardMarkup(keyboard)
bot.replyText(u,"<b>Hi These Are ChatAction Of Telegram</b>",reply_markup=markup)
🧩 Command:- /ChatAction
try:
bot.sendChatAction(chat_id=message.chat.id,action=params)
except:
pass
🎉16❤15👏10🤩9👍8🥰8🔥6
Need YouTube Subscription Code
Check is Not Accurate Because Of YouTube But This Code Will Force User To Subscribe your Channel
After User have To Send Photo To Admin From Bot Than You Can Approved Him to Withdrawal Or To run Particular Command.
Check is Not Accurate Because Of YouTube But This Code Will Force User To Subscribe your Channel
After User have To Send Photo To Admin From Bot Than You Can Approved Him to Withdrawal Or To run Particular Command.
Anonymous Poll
100%
YES we need
0%
No need
🎉17🔥15👍11🤩10❤7🥰5👏5
How to Force User To Subscribe Your Channel ❓
🧩 Command:- /YouTube
🧩 Command:- /YouTube
if params == "Done":
try:
bot.deleteMessage(chat_id=u, message_id= message.message_id)
except:
bot.answerCallbackQuery(call.id,'''🥲You Have Clicked Too Much On 😇Done? Click Here''',show_alert=False) #False for alert on top
raise ReturnCommand ()
urlh = "https://youtu.be/jnr99lWBTF4"
hi = f"""<a href="{urlh}">Channel</a>"""
if params != "Done":
Text = f"<b>Subscribe To Our {hi}👇</b>"
else:
Text = f"<b>You Have Not Subscribed Our {hi}👇</b>"
markup = InlineKeyboardMarkup()
markup.add(InlineKeyboardButton(
text='Subscribe To YT',url='https://youtu.be/jnr99lWBTF4'))
markup.add(InlineKeyboardButton(
text='😇 Done? Click Here',
callback_data='/YouTube Done')) #add your inline button with InlineKeyboardButton
markup.add(InlineKeyboardButton(
text='😎\nFor Developer\n Click Here',
url=f'tg://user?id=5797764799'))
bot.replyText(
chat_id = u,
text =Text,
reply_markup = markup
,disable_web_page_preview= True)
🥰13🎉13👍11🔥10👏9❤8🤩7
How To Get Channel Current Member Count (using Method)❓
Complete 40 Member
🤩13❤10👏10👍9🥰9🎉9🔥8
How To Send Poll Using Bot❓
question = 'What is your favorite programming language?'
options = ['Python', 'Java', 'C++', 'JavaScript']
bot.sendPoll(chat_id=u, question=question, options=options)
🥰14❤12🔥12👏12👍8🤩8🎉6
🥰14🎉14👏12🤩11❤8👍6🔥6
How to Pin Any Message in Tbc❓
h = bot.replyText("@Tbc_Codes","This Message Will Get Pinnned")
bot.pinChatMessage(chat_id="@Tbc_Codes", message_id=h.message_id)🔥15👏12👍11🎉9🤩9❤7🥰7
Click Below To Check You Are Admin Or What
Recently Clicked By :- Irfan (member)
Recently Clicked By :- Irfan (member)
🎉14🔥13🤩12👍10🥰9❤6👏6
How To Get Channel Current Member Count (using Method)❓
chat_id = '@Telegram'
h = bot.getChatMembersCount(chat_id)
bot.sendMessage(h)
🤩13🔥12🥰11🎉10👍9❤8👏7
❤14👍10👏10🎉10🤩10🔥8🥰8
Advance Multiple Admin Check Code⁉️
🧩 Command:- /Adminhelp
#########################
#codes to be executed
🧩 Command:- /Adminhelp
AllBotAdminss = ["5797764799","1449999447"]
#Enter Your and you friends Userid
is_Admin = False
for userid in AllBotAdminss:
if str(message.chat.id) == str(userid):
is_Admin = True
if is_Admin != True:
bot.sendMessage(f"""<b>Your Chat ID : {u}</b>""")
raise ReturnCommand()
#########################
#codes to be executed
👏13🔥12🥰12👍11🤩9❤7🎉7
If You Left This Channel And Clicked This You Will Get Banned.
You Will Get Unbanned Automatically After A Delay Of 5 Second
You Will Get Unbanned Automatically After A Delay Of 5 Second
❤15👍15🤩10🥰9👏9🎉8🔥5
How to edit Time Count Every 3 Second
#Not Tbc
import telebot
import datetime
import time
bot = telebot.TeleBot('Bot Token')
total_edits = 0
while True:
current_time = datetime.datetime.now().strftime('%H:%M:%S')
message_text = f'*Current time is {current_time}\n👆Total Edit Count = {total_edits}*'
chat_id = "@ChannelUsername"
message_id = message I'd
print(current_time)
bot.edit_message_text(chat_id=chat_id, message_id=message_id, text=message_text,parse_mode="markdown")
total_edits += 3
time.sleep(3)
bot.polling()
#Not Tbc
👍17🥰14🤩13👏10❤7🔥5🎉5
⚠️ Don't reduce
Else You got Error:
time.sleep(3)Else You got Error:
A request to the Telegram API was unsuccessful. Error code: 429. Description: Too Many Requests: retry after 10🎉13🔥12👏11🤩10👍9❤8🥰7