From 760c84d91dd5a30d9e7cef4c48b362b4bc2f0647 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 6 Nov 2017 13:35:40 -0500 Subject: [PATCH] get_user and get_guild are better --- fight/fight.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fight/fight.py b/fight/fight.py index f9f8ae5..ee601b0 100644 --- a/fight/fight.py +++ b/fight/fight.py @@ -494,7 +494,7 @@ class Fight: :param message_id: :return: """ - for channel in ctx.guild.channels: + for channel in ctx.guild.text_channels: try: return await channel.get_message(message_id) except discord.NotFound: @@ -509,11 +509,12 @@ class Fight: return discord.utils.get(guild.channels, id=channelid) def _get_user_from_id(self, guildID, userid): - guild = self._get_guild_from_id(guildID) - return discord.utils.get(guild.members, id=userid) + # guild = self._get_guild_from_id(guildID) + # return discord.utils.get(guild.members, id=userid) + return self.bot.get_user(userid) def _get_guild_from_id(self, guildID): - return discord.utils.get(self.bot.guilds, id=guildID) + return self.bot.get_guild(guildID) def _getfight(self, guildID, tID): return self.the_data[guildID]["TOURNEYS"][tID]