Giter Club home page Giter Club logo

import telebot from telebot import types import requests

API_KEY = "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" BOT_TOKEN = "6573158663:AAElXYSII-NZt1s1OCzPJ0Dm_KFhrPnJcLc"

bot = telebot.TeleBot(BOT_TOKEN)

@bot.message_handler(commands=['start']) def start(message): bot.reply_to(message,"๐Ÿค") markup = types.InlineKeyboardMarkup() btn = types.InlineKeyboardButton(text='GPT4 TURBO UPDATES', url='https://t.me/GPT4_TURBO') markup.add(btn) bot.send_message(message.chat.id, f"Hello : {message.from_user.first_name}\nI am a bot made with GPT-4 Artificial Intelligence. \nIf you ask me a question, I will answer you quickly. Before you ask, click on the button andย  Join my channel.",parse_mode="HTML", reply_markup=markup)

def get_response(message): url = "https://api.openai.com/v1/chat/completions" headers = { "Authorization": f"Bearer {API_KEY}" } data = { "model": "gpt-3.5-turbo", "messages": [ { "role": "user", "content": message } ] } response = requests.post(url, headers=headers, json=data) return response.json()["choices"][0]["message"]["content"]

@bot.message_handler(func=lambda message: True) def reply_to_message(message): markup = types.InlineKeyboardMarkup() btn = types.InlineKeyboardButton(text='๐Ÿ“ฃ ๐™‚๐™‹๐™-4 ๐—•๐—ผ๐˜ ๐—จ๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ๐˜€', url='https://t.me/GPT4_TURBO') markup.add(btn) chat_id = message.chat.id message_text = message.text test = get_response(message_text) bot.send_message(chat_id, "Hello"+test+"\n\n๐Ÿค– @GPT4TURB0BOT",parse_mode="Markdown",reply_markup=markup, reply_to_message_id=message.message_id)

bot.polling()

michaelbelayneh's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.