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

AttributeError: 'GiftEvent' object has no attribute 'streakable' #184

Closed
IrineuJr1987 opened this issue Feb 25, 2024 · 2 comments
Closed
Assignees

Comments

@IrineuJr1987
Copy link

When trying to run the method to retrieve gift information, the following error occurs: AttributeError: ‘GiftEvent’ object has no attribute ‘streakable’

@client.on(GiftEvent)
async def on_gift(event: GiftEvent):
  

    # Streakable gift & streak is over
    if event.gift.streakable and not event.streaking:
        print(f"{event.user.unique_id} sent {event.gift.count}x \"{event.gift.name}\"")

    # Non-streakable gift
    elif not event.gift.streakable:
        print(f"{event.user.unique_id} sent \"{event.gift.name}\"")
@Opybot
Copy link

Opybot commented Mar 2, 2024

Using the example script
gifts.py

AttributeError: 'ExtendedGiftStruct' object has no attribute 'count'
AttributeError: 'ExtendedGiftStruct' object has no attribute 'info'

// OUTDATED EXAMPLE FILES? correct use:

gift_name = event.gift.name
diamond_count = event.gift.diamond_count
combo = event.gift.combo

@IrineuJr1987
Copy link
Author

Thankyou

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

No branches or pull requests

3 participants