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

feat: add fail_if_not_exists for PrefixedContext.reply #1608

Merged

Conversation

AstreaTSS
Copy link
Member

@AstreaTSS AstreaTSS commented Feb 21, 2024

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This is a simple PR to add fail_if_not_exists to PrefixedContext.reply. Really, I have to question why fail_if_not_exists doesn't default to False - regardless, people at least have the option now.

Changes

  • Add fail_if_not_exists to PrefixedContext.reply.

Related Issues

Test Scenarios

@prefixed_command()
async def some_cmd(ctx: PrefixedContext):
    await ctx.message.delete()
    await ctx.reply("Hello!")  # will fail
    # meanwhile, await ctx.reply("Hello!", fail_if_not_exists=False) will work with this PR

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

Copy link
Collaborator

@FayeDel FayeDel left a comment

Choose a reason for hiding this comment

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

Can't currently test, but looks good to me 👍🏻

@eightween eightween added enhancement New feature or request pending Pending approve labels Mar 13, 2024
@AstreaTSS AstreaTSS merged commit 5518474 into interactions-py:unstable Mar 14, 2024
2 checks passed
@AstreaTSS AstreaTSS deleted the fail_if_not_exists_ctx_reply branch March 14, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending Pending approve
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants