Skip to content

feat: cache voice channel info from gateway - #3210

Open
plun1331 wants to merge 41 commits into
masterfrom
feat/channel-status-gateway
Open

plun1331 wants to merge 41 commits into
masterfrom
feat/channel-status-gateway

Conversation

@plun1331

@plun1331 plun1331 commented Apr 20, 2026 •

Copy link
Copy Markdown
Member

Summary

https://docs.discord.com/developers/change-log#voice-channel-status-and-start-time-documentation

  • Adds support for Request Channel Info
  • Adds a flag to Client to automatically request and cache channel info at startup (cache_channel_info, default False)
  • Adds voice_channel_start_time_update event
  • Adds voice_start_time to voice channels.
  • Reworks how status is stored on voice channels.

Generative AI was used for finding bugs and working on the gateway request handling in autoshardedbot.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@pycord-app

pycord-app Bot commented Apr 20, 2026

Copy link
Copy Markdown

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3210/head:pr-3210
git checkout pr-3210

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3210/head

@plun1331
plun1331 marked this pull request as ready for review April 20, 2026 23:22
@plun1331
plun1331 requested review from a team, Lumabots and Paillat-dev April 20, 2026 23:22
@plun1331
plun1331 requested a review from a team as a code owner April 20, 2026 23:22
@plun1331
plun1331 requested review from Icebluewolf and Soheab April 20, 2026 23:22
@plun1331

Copy link
Copy Markdown
Member Author

Test code I've been using:

import asyncio

import discord
import logging

logging.basicConfig(level=logging.DEBUG)

client = discord.Client(cache_channel_info=True, intents=discord.Intents.all(), chunk_guilds_at_startup=False)


@client.event
async def on_ready():
    while True:
        for channel in client.get_all_channels():
            if hasattr(channel, "voice_start_time") and channel.voice_start_time:
                print("rec", getattr(channel, "status", ...), channel.voice_start_time)


@client.event
async def on_voice_channel_status_update(channel, old, new):
    print("status", channel.status, channel.voice_start_time, old, new)


@client.event
async def on_voice_channel_start_time_update(channel, old, new):
    print("start", channel.status, channel.voice_start_time, old, new)


client.run("token")

@plun1331

Copy link
Copy Markdown
Member Author

Needs input: API for ChannelInfo and Guild.channel_info()

@plun1331 plun1331 added the feature Implements a feature label Apr 20, 2026
Comment thread discord/channel.py Resolved
Comment thread discord/state.py Resolved
Comment thread discord/state.py Resolved
@plun1331 plun1331 moved this from Todo to In Progress in Pycord Oct 26, 2026
Comment thread CHANGELOG.md Resolved
Co-authored-by: Paillat <paillat@pycord.dev>
Signed-off-by: plun1331 <plun@plunthe.dev>
Paillat-dev
Paillat-dev previously approved these changes Oct 27, 2026

@Paillat-dev Paillat-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yolo lgtm

Signed-off-by: plun1331 <plun1331@gmail.com>
@plun1331

Copy link
Copy Markdown
Member Author

this needs to be retested probably

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants