From 65bd510df615ce112d80913ff9b03508858f0ea3 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 18 Apr 2017 04:07:05 -0400 Subject: [PATCH] Add Guild.voice_client shortcut. --- discord/guild.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/guild.py b/discord/guild.py index 0c218c26c..209d057bd 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -32,7 +32,6 @@ from collections import namedtuple from . import utils from .role import Role from .member import Member, VoiceState -from .emoji import Emoji from .game import Game from .permissions import PermissionOverwrite from .colour import Colour @@ -282,6 +281,11 @@ class Guild(Hashable): self_id = self._state.user.id return self.get_member(self_id) + @property + def voice_client(self): + """Returns the :class:`VoiceClient` associated with this guild, if any.""" + return self._state._get_voice_client(self.id) + @property def text_channels(self): """List[:class:`TextChannel`]: A list of text channels that belongs to this guild.