import discord
from discord.ext import commands
from discord.ui import Buttons,View
intents = disocrd.Intents().all()
intents.message_content = True
bot = commands.Bot(command_prefix="#", intents=intents)
@bot.command()
async def button(ctx):
button = Button(label="Click for lock channel", style=disocrd.ButtonStyle.red)
async def button_callback(interaction):
await ctx.channel.set_permissions(ctx.guild.default_role, send_messages=False)
await ctx.send("DOne")
button.callback = button_callback
view = View()
view.add_item(button)
await ctx.send("this is for grepper", view=view)
bot.run("token")