[Audio] Fix DM Crash (#3880)

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
Draper 2020-06-11 15:50:23 +01:00 committed by GitHub
parent e3322af384
commit 17496ff5cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,17 +44,19 @@ class DpyEvents(MixinMeta, metaclass=CompositeMetaClass):
# notify_channel = player.fetch("channel") # notify_channel = player.fetch("channel")
# if not notify_channel: # if not notify_channel:
# player.store("channel", ctx.channel.id) # player.store("channel", ctx.channel.id)
self._daily_global_playlist_cache.setdefault(
self.bot.user.id, await self.config.daily_playlists()
)
if self.local_folder_current_path is None:
self.local_folder_current_path = Path(await self.config.localpath())
if not ctx.guild:
return
dj_enabled = self._dj_status_cache.setdefault( dj_enabled = self._dj_status_cache.setdefault(
ctx.guild.id, await self.config.guild(ctx.guild).dj_enabled() ctx.guild.id, await self.config.guild(ctx.guild).dj_enabled()
) )
self._daily_playlist_cache.setdefault( self._daily_playlist_cache.setdefault(
ctx.guild.id, await self.config.guild(ctx.guild).daily_playlists() ctx.guild.id, await self.config.guild(ctx.guild).daily_playlists()
) )
self._daily_global_playlist_cache.setdefault(
self.bot.user.id, await self.config.daily_playlists()
)
if self.local_folder_current_path is None:
self.local_folder_current_path = Path(await self.config.localpath())
if dj_enabled: if dj_enabled:
dj_role = self._dj_role_cache.setdefault( dj_role = self._dj_role_cache.setdefault(
ctx.guild.id, await self.config.guild(ctx.guild).dj_role() ctx.guild.id, await self.config.guild(ctx.guild).dj_role()