Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery Starbot ⭐ refactored ibrother/chatgpt-telegram-bot #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch https://github.com/sourcery-ai-bot/chatgpt-telegram-bot main
git merge --ff-only FETCH_HEAD
git reset HEAD^

resp = await client.chat.completions.create(
model=MODEL,
messages=message
)
return resp
return await client.chat.completions.create(model=MODEL, messages=message)
Copy link
Author

Choose a reason for hiding this comment

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

Function call_openai_chatgpt refactored with the following changes:

Comment on lines -104 to +108
if (update.message.chat.type == 'private' and chat_id in authorized_user_ids) or (
update.message.chat.type == 'supergroup' and chat_id in authorized_group_ids and '@{}'.format(
context.bot.username) in update.message.text):
if (
(
update.message.chat.type == 'private'
and chat_id in authorized_user_ids
)
or update.message.chat.type == 'supergroup'
and chat_id in authorized_group_ids
and f'@{context.bot.username}' in update.message.text
):
Copy link
Author

Choose a reason for hiding this comment

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

Function message_handler refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant