so i was trying to make a raidmode command and i want it to revoke send_messages perms to all channels.... but i m getting an error. any help is appriciated! :D
@commands.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def raidmode(self, ctx, section):
if section == 'on':
guild = ctx.guild
channels = guild.get_all_channels()
role = discord.utils.get(guild.roles, name="@everyone")
await channels.set_permissions(role, send_messages=False)
mbed = discord.Embed(description="Raid Mode Is Enabled!", color=0xe74c3c)
await ctx.send(embed=mbed)
return
if section == 'off':
guild = ctx.guild
channels = guild.get_all_channels()
role = discord.utils.get(guild.roles, name="@everyone")
await channels.set_permissions(role, send_messages=True)
m1bed = discord.Embed(description="Raid Mode Is Disabled!", color=0xe74c3c)
await ctx.send(embed=m1bed)
return
ERROR
channels = guild.get_all_channels()
AttributeError: 'Guild' object has no attribute 'get_all_channels'