mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 14:37:02 +01:00
Bugfix if guild not initialized yet and no reactions
This commit is contained in:
parent
ec80761a5f
commit
e566276fc4
@ -229,7 +229,8 @@ class Titan(discord.AutoShardedClient):
|
|||||||
me = channel.guild.get_member(self.user.id)
|
me = channel.guild.get_member(self.user.id)
|
||||||
if channel.permissions_for(me).read_messages:
|
if channel.permissions_for(me).read_messages:
|
||||||
message = await channel.get_message(message_id)
|
message = await channel.get_message(message_id)
|
||||||
await self.on_reaction_add(message.reactions[0], None)
|
if len(message.reactions):
|
||||||
|
await self.on_reaction_add(message.reactions[0], None)
|
||||||
|
|
||||||
async def on_raw_reaction_remove(self, payload):
|
async def on_raw_reaction_remove(self, payload):
|
||||||
message_id = payload.message_id
|
message_id = payload.message_id
|
||||||
|
@ -139,8 +139,11 @@ class RedisQueue:
|
|||||||
guild = self.bot.get_guild(int(params["guild_id"]))
|
guild = self.bot.get_guild(int(params["guild_id"]))
|
||||||
query = params["query"]
|
query = params["query"]
|
||||||
result = None
|
result = None
|
||||||
members = guild.members
|
if guild:
|
||||||
if len(query) > 5 and query[-5] == '#':
|
members = guild.members
|
||||||
|
else:
|
||||||
|
members = None
|
||||||
|
if members and len(query) > 5 and query[-5] == '#':
|
||||||
potential_discriminator = query[-4:]
|
potential_discriminator = query[-4:]
|
||||||
result = discord.utils.get(members, name=query[:-5], discriminator=potential_discriminator)
|
result = discord.utils.get(members, name=query[:-5], discriminator=potential_discriminator)
|
||||||
if not result:
|
if not result:
|
||||||
|
Loading…
Reference in New Issue
Block a user