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

Unhandled code branch in jishaku voice command. #207

Open
4 tasks done
AbstractUmbra opened this issue Jul 20, 2023 · 0 comments
Open
4 tasks done

Unhandled code branch in jishaku voice command. #207

AbstractUmbra opened this issue Jul 20, 2023 · 0 comments

Comments

@AbstractUmbra
Copy link
Contributor

Summary

An error occurs when using jishaku voice when the bot in question is not currently within a voice channel.

Reproduction steps

Use jishaku voice when the bot is not in your current voice channel.

Expected results

The bot will mention that it is not connected to voice.

Actual results

The bot hits a traceback:-

Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/jishaku/features/voice.py", line 101, in jsk_voice
    await ctx.send(f"Connected to {voice.channel} with a custom VoiceProtocol: {voice}")
                                   ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'channel'

It seems to stem from an unhandled code path in the else statement here.

Checklist

  • I have updated discord.py and jishaku to the latest available versions and have confirmed that this issue is still present
  • 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

System information

Jishaku v2.5.1a478+g4590932.master, discord.py 2.4.0a4877+g270fa5f2, Python 3.11.4 (main, Jul  4 2023, 05:35:05) [GCC 12.2.0] on linux
Module was loaded 6 days ago, cog was loaded 6 days ago.

Using 415.57 MiB physical memory and 1.45 GiB virtual memory, 402.52 MiB of which unique to this process.
Running on PID 7 (python) with 19 thread(s).

This bot is not sharded and can see 8 guilds and 43139 users.
Message cache capped at 1000, presences intent is enabled, members intent is enabled, and message content intent is enabled.
Average websocket latency: 104.13ms
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

1 participant