Skip to content

Commit

Permalink
release: 1.58.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Dec 17, 2024
1 parent 6935dfd commit 19ecaaf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.58.0"
".": "1.58.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.58.1 (2024-12-17)

Full Changelog: [v1.58.0...v1.58.1](https://github.com/openai/openai-python/compare/v1.58.0...v1.58.1)

### Documentation

* **readme:** fix example script link ([23ba877](https://github.com/openai/openai-python/commit/23ba8778fd55e0f54f36685e9c5950b452d8e10c))

## 1.58.0 (2024-12-17)

Full Changelog: [v1.57.4...v1.58.0](https://github.com/openai/openai-python/compare/v1.57.4...v1.58.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "1.58.0"
version = "1.58.1"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "1.58.0" # x-release-please-version
__version__ = "1.58.1" # x-release-please-version

4 comments on commit 19ecaaf

@qwqdda
Copy link

@qwqdda qwqdda commented on 19ecaaf Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import requests
import json
import pandas as pd
from datetime import datetime
import sqlite3

class AdvancedBot:
def init(self, token):
self.updater = Updater(token, use_context=True)
self.dp = self.updater.dispatcher
self.setup_database()
self.setup_handlers()

def setup_database(self):
    self.conn = sqlite3.connect('bot_database.db')
    self.cur = self.conn.cursor()
    self.cur.execute('''
        CREATE TABLE IF NOT EXISTS users 
        (user_id INTEGER PRIMARY KEY, 
        username TEXT,
        first_seen DATETIME)
    ''')
    self.conn.commit()

def setup_handlers(self):
    self.dp.add_handler(CommandHandler("start", self.start))
    self.dp.add_handler(CommandHandler("weather", self.weather))
    self.dp.add_handler(CommandHandler("stats", self.stats))
    self.dp.add_handler(MessageHandler(Filters.text & ~Filters.command, self.echo))

def start(self, update, context):
    user_id = update.message.from_user.id
    username = update.message.from_user.username
    current_time = datetime.now()
    
    self.cur.execute('''
        INSERT OR IGNORE INTO users (user_id, username, first_seen) 
        VALUES (?, ?, ?)
    ''', (user_id, username, current_time))
    self.conn.commit()
    
    update.message.reply_text('مرحباً! أنا بوت متقدم يمكنني مساعدتك في عدة مهام.')

def weather(self, update, context):
    if len(context.args) < 1:
        update.message.reply_text('الرجاء إدخال اسم المدينة')
        return

    city = ' '.join(context.args)
    api_key = 'YOUR_WEATHER_API_KEY'  # يجب استبدالها بمفتاح API حقيقي
    url = f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric'
    
    try:
        response = requests.get(url)
        data = json.loads(response.text)
        temp = data['main']['temp']
        weather_desc = data['weather'][0]['description']
        update.message.reply_text(f'الطقس في {city}:\nدرجة الحرارة: {temp}°C\nالوصف: {weather_desc}')
    except:
        update.message.reply_text('عذراً، لم أستطع العثور على معلومات الطقس')

def stats(self, update, context):
    self.cur.execute('SELECT COUNT(*) FROM users')
    user_count = self.cur.fetchone()[0]
    update.message.reply_text(f'عدد المستخدمين الكلي: {user_count}')

def echo(self, update, context):
    update.message.reply_text(update.message.text)

def run(self):
    self.updater.start_polling()
    self.updater.idle()

def main():
bot = AdvancedBot("7628396387:AAHWYlcoXPlonzhCmimp0g0ybJEGT8zKUd8")
bot.run()

if name == 'main':
main()

@qwqdda
Copy link

@qwqdda qwqdda commented on 19ecaaf Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import requests
import json
import pandas as pd
from datetime import datetime
import sqlite3

class AdvancedBot:
def init(self, token):
self.updater = Updater(token, use_context=True)
self.dp = self.updater.dispatcher
self.setup_database()
self.setup_handlers()

def setup_database(self):
    self.conn = sqlite3.connect('bot_database.db')
    self.cur = self.conn.cursor()
    self.cur.execute('''
        CREATE TABLE IF NOT EXISTS users 
        (user_id INTEGER PRIMARY KEY, 
        username TEXT,
        first_seen DATETIME)
    ''')
    self.conn.commit()

def setup_handlers(self):
    self.dp.add_handler(CommandHandler("start", self.start))
    self.dp.add_handler(CommandHandler("weather", self.weather))
    self.dp.add_handler(CommandHandler("stats", self.stats))
    self.dp.add_handler(MessageHandler(Filters.text & ~Filters.command, self.echo))

def start(self, update, context):
    user_id = update.message.from_user.id
    username = update.message.from_user.username
    current_time = datetime.now()
    
    self.cur.execute('''
        INSERT OR IGNORE INTO users (user_id, username, first_seen) 
        VALUES (?, ?, ?)
    ''', (user_id, username, current_time))
    self.conn.commit()
    
    update.message.reply_text('مرحباً! أنا بوت متقدم يمكنني مساعدتك في عدة مهام.')

def weather(self, update, context):
    if len(context.args) < 1:
        update.message.reply_text('الرجاء إدخال اسم المدينة')
        return

    city = ' '.join(context.args)
    api_key = 'YOUR_WEATHER_API_KEY'  # يجب استبدالها بمفتاح API حقيقي
    url = f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric'
    
    try:
        response = requests.get(url)
        data = json.loads(response.text)
        temp = data['main']['temp']
        weather_desc = data['weather'][0]['description']
        update.message.reply_text(f'الطقس في {city}:\nدرجة الحرارة: {temp}°C\nالوصف: {weather_desc}')
    except:
        update.message.reply_text('عذراً، لم أستطع العثور على معلومات الطقس')

def stats(self, update, context):
    self.cur.execute('SELECT COUNT(*) FROM users')
    user_count = self.cur.fetchone()[0]
    update.message.reply_text(f'عدد المستخدمين الكلي: {user_count}')

def echo(self, update, context):
    update.message.reply_text(update.message.text)

def run(self):
    self.updater.start_polling()
    self.updater.idle()

def main():
bot = AdvancedBot("7628396387:AAHWYlcoXPlonzhCmimp0g0ybJEGT8zKUd8")
bot.run()

if name == 'main':
main()

@qwqdda
Copy link

@qwqdda qwqdda commented on 19ecaaf Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import requests
import json
import pandas as pd
from datetime import datetime
import sqlite3

class AdvancedBot:
def init(self, token):
self.updater = Updater(token, use_context=True)
self.dp = self.updater.dispatcher
self.setup_database()
self.setup_handlers()

def setup_database(self):
    self.conn = sqlite3.connect('bot_database.db')
    self.cur = self.conn.cursor()
    self.cur.execute('''
        CREATE TABLE IF NOT EXISTS users 
        (user_id INTEGER PRIMARY KEY, 
        username TEXT,
        first_seen DATETIME)
    ''')
    self.conn.commit()

def setup_handlers(self):
    self.dp.add_handler(CommandHandler("start", self.start))
    self.dp.add_handler(CommandHandler("weather", self.weather))
    self.dp.add_handler(CommandHandler("stats", self.stats))
    self.dp.add_handler(MessageHandler(Filters.text & ~Filters.command, self.echo))

def start(self, update, context):
    user_id = update.message.from_user.id
    username = update.message.from_user.username
    current_time = datetime.now()
    
    self.cur.execute('''
        INSERT OR IGNORE INTO users (user_id, username, first_seen) 
        VALUES (?, ?, ?)
    ''', (user_id, username, current_time))
    self.conn.commit()
    
    update.message.reply_text('مرحباً! أنا بوت متقدم يمكنني مساعدتك في عدة مهام.')

def weather(self, update, context):
    if len(context.args) < 1:
        update.message.reply_text('الرجاء إدخال اسم المدينة')
        return

    city = ' '.join(context.args)
    api_key = 'YOUR_WEATHER_API_KEY'  # يجب استبدالها بمفتاح API حقيقي
    url = f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric'
    
    try:
        response = requests.get(url)
        data = json.loads(response.text)
        temp = data['main']['temp']
        weather_desc = data['weather'][0]['description']
        update.message.reply_text(f'الطقس في {city}:\nدرجة الحرارة: {temp}°C\nالوصف: {weather_desc}')
    except:
        update.message.reply_text('عذراً، لم أستطع العثور على معلومات الطقس')

def stats(self, update, context):
    self.cur.execute('SELECT COUNT(*) FROM users')
    user_count = self.cur.fetchone()[0]
    update.message.reply_text(f'عدد المستخدمين الكلي: {user_count}')

def echo(self, update, context):
    update.message.reply_text(update.message.text)

def run(self):
    self.updater.start_polling()
    self.updater.idle()

def main():
bot = AdvancedBot("7628396387:AAHWYlcoXPlonzhCmimp0g0ybJEGT8zKUd8")
bot.run()

if name == 'main':
main()

@qwqdda
Copy link

@qwqdda qwqdda commented on 19ecaaf Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import requests
import json
import pandas as pd
from datetime import datetime
import sqlite3

class AdvancedBot:
def init(self, token):
self.updater = Updater(token, use_context=True)
self.dp = self.updater.dispatcher
self.setup_database()
self.setup_handlers()

def setup_database(self):
    self.conn = sqlite3.connect('bot_database.db')
    self.cur = self.conn.cursor()
    self.cur.execute('''
        CREATE TABLE IF NOT EXISTS users 
        (user_id INTEGER PRIMARY KEY, 
        username TEXT,
        first_seen DATETIME)
    ''')
    self.conn.commit()

def setup_handlers(self):
    self.dp.add_handler(CommandHandler("start", self.start))
    self.dp.add_handler(CommandHandler("weather", self.weather))
    self.dp.add_handler(CommandHandler("stats", self.stats))
    self.dp.add_handler(MessageHandler(Filters.text & ~Filters.command, self.echo))

def start(self, update, context):
    user_id = update.message.from_user.id
    username = update.message.from_user.username
    current_time = datetime.now()
    
    self.cur.execute('''
        INSERT OR IGNORE INTO users (user_id, username, first_seen) 
        VALUES (?, ?, ?)
    ''', (user_id, username, current_time))
    self.conn.commit()
    
    update.message.reply_text('مرحباً! أنا بوت متقدم يمكنني مساعدتك في عدة مهام.')

def weather(self, update, context):
    if len(context.args) < 1:
        update.message.reply_text('الرجاء إدخال اسم المدينة')
        return

    city = ' '.join(context.args)
    api_key = 'YOUR_WEATHER_API_KEY'  # يجب استبدالها بمفتاح API حقيقي
    url = f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric'
    
    try:
        response = requests.get(url)
        data = json.loads(response.text)
        temp = data['main']['temp']
        weather_desc = data['weather'][0]['description']
        update.message.reply_text(f'الطقس في {city}:\nدرجة الحرارة: {temp}°C\nالوصف: {weather_desc}')
    except:
        update.message.reply_text('عذراً، لم أستطع العثور على معلومات الطقس')

def stats(self, update, context):
    self.cur.execute('SELECT COUNT(*) FROM users')
    user_count = self.cur.fetchone()[0]
    update.message.reply_text(f'عدد المستخدمين الكلي: {user_count}')

def echo(self, update, context):
    update.message.reply_text(update.message.text)

def run(self):
    self.updater.start_polling()
    self.updater.idle()

def main():
bot = AdvancedBot("7628396387:AAHWYlcoXPlonzhCmimp0g0ybJEGT8zKUd8")
bot.run()

if name == 'main':
main()

Please sign in to comment.