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_event.edit does not work if location changed from external to voice #1847

Closed
3 tasks done
Snawe opened this issue Dec 30, 2022 · 0 comments · Fixed by #1998
Closed
3 tasks done

scheduled_event.edit does not work if location changed from external to voice #1847

Snawe opened this issue Dec 30, 2022 · 0 comments · Fixed by #1998
Assignees
Labels
bug Something isn't working priority: medium Medium Priority
Milestone

Comments

@Snawe
Copy link
Contributor

Snawe commented Dec 30, 2022

Summary

If you create a scheduled event with a string as location (external) and than edit it to a voice channel, the edit fails

Reproduction Steps

  • create scheduled event with string as location
  • create a voice channel
  • edit the scheduled event and pass the voice channel as location

Minimal Reproducible Code

@slash_command(description = "test")
    async def test_scheduled(self, ctx: discord.ApplicationContext):
        scheduled_event = await ctx.guild.create_scheduled_event(
            name="event name",
            description="event description",
            start_time=datetime.utcnow() + timedelta(minutes=1),
            end_time=datetime.utcnow() + timedelta(minutes=5),
            location="Unknown",
        )
        # Create a voice channel and pass it below
        voice = await ctx.guild.create_voice_channel("new channel")

        await scheduled_event.edit(location=voice)

Expected Results

New location is the voice channel

Actual Results

Traceback (most recent call last):
  File "/home/bot/testing/cogs/cog_testing.py", line 121, in test_scheduled
      await scheduled_event.edit(
  File "/home/bot/testing/venv/lib/site-packages/discord/scheduled_events.py", line 377, in edit
      data = await self._state.http.edit_scheduled_event(
  File "/home/bot/testing/venv/lib/site-packages/discord/http.py", line 366, in request
      raise HTTPException(response, data)
  discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
  In channel_id: Invalid channel type for event.

Intents

all

System Information

  • Python v3.9.4-final
  • py-cord v2.3.None-final
  • aiohttp v3.8.3

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

The issue seems to be that the edit function completely ignores the entity_type (doc ) which should change from external to voice in the case above.

Chaning the location from one voice channel to an other works fine.

@Snawe Snawe added the unconfirmed bug A bug report that needs triaging label Dec 30, 2022
@Lulalaby Lulalaby added the priority: medium Medium Priority label Feb 9, 2023
@Lulalaby Lulalaby added this to the v2.5 milestone Feb 10, 2023
@Middledot Middledot self-assigned this Apr 2, 2023
@Middledot Middledot added bug Something isn't working priority: medium Medium Priority and removed priority: medium Medium Priority unconfirmed bug A bug report that needs triaging labels Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: medium Medium Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants