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

scheduled_events method of Guild Object isn't working as it should #1364

Closed
3 tasks done
eitozx opened this issue May 16, 2022 · 4 comments · Fixed by #1369
Closed
3 tasks done

scheduled_events method of Guild Object isn't working as it should #1364

eitozx opened this issue May 16, 2022 · 4 comments · Fixed by #1369
Labels
bug Something isn't working

Comments

@eitozx
Copy link
Contributor

eitozx commented May 16, 2022

Summary

It gives TypeError where it should return the list of scheduled events

Reproduction Steps

I used jishaku and did the following:

!jsk py _ctx.guild.scheduled_events

Minimal Reproducible Code

@bot jsk py _ctx.guild.scheduled_events

Expected Results

I expect it to return ScheduledEvent Object just like how it is suppose to work.
When I tried the same thing (ctx.guild.scheduled_events) with discord.py, i was able to retrieve ScheduledEvent object as per my expectations.

Actual Results

i tried _ctx.guild.scheduled_events with jishaku and I got this

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/jishaku/features/python.py", line 145, in jsk_python
    async for send, result in AsyncSender(executor):
  File "/app/.heroku/python/lib/python3.9/site-packages/jishaku/functools.py", line 109, in _internal
    value = await base.asend(self.send_value)
  File "/app/.heroku/python/lib/python3.9/site-packages/jishaku/repl/compilation.py", line 140, in traverse
    async for send, result in AsyncSender(func(*self.args)):
  File "/app/.heroku/python/lib/python3.9/site-packages/jishaku/functools.py", line 109, in _internal
    value = await base.asend(self.send_value)
  File "<repl>", line 1, in _repl_coroutine
    _ctx.guild.scheduled_events.__repr__()
  File "/app/.heroku/python/lib/python3.9/site-packages/discord/scheduled_events.py", line 230, in __repr__
    f"<ScheduledEvent id={self.id} "
TypeError: __str__ returned non-string (type Object)

It's always TypeError when there is some scheduled event in guild (this is not fine), but when there's no scheduled, it returns an empty list (this is fine)

Intents

default intents

System Information

  • Python v3.10.4-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b7
  • aiohttp v3.8.1
  • system info: Windows 10 10.0.22000

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

@eitozx eitozx added the unconfirmed bug A bug report that needs triaging label May 16, 2022
plun1331 added a commit to plun1331/pycord that referenced this issue May 16, 2022
@plun1331
Copy link
Member

Can you check if the commit I added to my fork, plun1331@37b62c7, fixes this?

Also, are you using the latest version from GitHub? If not, I would see if that fixes the issue.

@eitozx
Copy link
Contributor Author

eitozx commented May 17, 2022

Also, are you using the latest version from GitHub? If not, I would see if that fixes the issue.

Yes, I'm using latest version from Github, master branch,,

@plun1331 plun1331 added more info required more information is required to proceed and removed more info required more information is required to proceed labels May 17, 2022
@eitozx
Copy link
Contributor Author

eitozx commented May 18, 2022

Well i noticed some weird stuff..
When I tried jsk py _ctx.guild.scheduled_events in one of my server.. it worked fine (img attached below):

image

But when I tried the same thing in another server.. it gave me error (image attached):

image

And the error that I received is:

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/site-packages/jishaku/features/python.py", line 151, in jsk_python
    send(await self.jsk_python_result_handling(ctx, result))
  File "/app/.heroku/python/lib/python3.9/site-packages/jishaku/features/python.py", line 101, in jsk_python_result_handling
    result = repr(result)
  File "/app/.heroku/python/lib/python3.9/site-packages/discord/scheduled_events.py", line 230, in __repr__
    f"<ScheduledEvent id={self.id} "
TypeError: __str__ returned non-string (type Object)

P.S: This all happened without using @plun1331 's commit. Informing cuz.. i just felt like telling 'bout this :>

@eitozx
Copy link
Contributor Author

eitozx commented May 18, 2022

Can you check if the commit I added to my fork, plun1331@37b62c7, fixes this?

yes @plun1331 , your commit is working, i tried it in the guild where i was getting the error & with your commit it worked totally fine. Waiting for commit to get merged in master branch ASAP 😐

@plun1331 plun1331 mentioned this issue May 18, 2022
7 tasks
@Middledot Middledot added bug Something isn't working and removed unconfirmed bug A bug report that needs triaging labels May 18, 2022
Middledot pushed a commit that referenced this issue May 18, 2022
Lulalaby pushed a commit that referenced this issue Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants