Skip to content

Commit

Permalink
text_channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastermind-sap committed Apr 16, 2021
1 parent 5a14e98 commit ce4c131
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 4 deletions.
Binary file modified cogs/__pycache__/akinator.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/chess.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/conversation.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/events.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/fun.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/help.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/mastermind.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/music.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/restricted.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/riddle.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/server.cpython-38.pyc
Binary file not shown.
Binary file modified cogs/__pycache__/utility.cpython-38.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self,bot):
@commands.Cog.listener()
async def on_guild_join(self, guild):
allowed = []
for channel in guild.channels:
for channel in guild.text_channels:
if channel.permissions_for(guild.me).send_messages and channel.permissions_for(guild.me).embed_links:
allowed.append(channel)

Expand All @@ -36,7 +36,7 @@ async def on_guild_join(self, guild):

@commands.Cog.listener()
async def on_member_join(self,member):
for channel in member.guild.channels:
for channel in member.guild.text_channels:
if ('welcome' in channel.name.lower()):
try:
welcome=discord.Embed(title=member.name,description=f"""Welcome to {member.guild} {member.mention}""",color=discord.Colour.red())
Expand All @@ -48,7 +48,7 @@ async def on_member_join(self,member):

@commands.Cog.listener()
async def on_member_remove(self,member):
for channel in member.guild.channels:
for channel in member.guild.text_channels:
if ('goodbye' in channel.name.lower()):
try:
left=discord.Embed(title=member.name,description=f"""{member.mention} left the server""",color=discord.Colour.red())
Expand Down
2 changes: 1 addition & 1 deletion cogs/restricted.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def msgservers(self,ctx,*,text):
activeservers = self.bot.guilds
for guild in activeservers:
allowed=[]
for channel in guild.channels:
for channel in guild.text_channels:
if channel.permissions_for(guild.me).send_messages and channel.permissions_for(guild.me).embed_links:
allowed.append(channel)
if len(allowed) >= 1:
Expand Down

0 comments on commit ce4c131

Please sign in to comment.