Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

channel lock command in discord.py

#lock command
@bot.command(help=" Use this command to lock a channel")
@commands.has_permissions(manage_channels=True)
async def lock(ctx):
    await ctx.channel.set_permissions(ctx.guild.default_role,send_messages=False)
    await ctx.send('**<:vf:947194381172084767> Channel has been locked**')
    await ctx.channel.purge(limit=2)
Comment

channel unlock command in discord.py

#unlock command
@bot.command(help=" Use this command to lock a channel")
@commands.has_permissions(manage_channels=True)
async def unlock(ctx):
    await ctx.channel.set_permissions(ctx.guild.default_role,send_messages=True)
    await ctx.send('**<:vf:947194381172084767> Channel has been unlocked**')
    await ctx.channel.purge(limit=2)
Comment

PREVIOUS NEXT
Code Example
Python :: distinct rows in this DataFrame 
Python :: ternary operator python 
Python :: import django-on-heroku 
Python :: python list all files of directory in given pattern 
Python :: html to docx python 
Python :: python remove nan rows 
Python :: python xml replace attribute value 
Python :: pandas filter every column not null 
Python :: starting vscode on colab 
Python :: python open file 
Python :: how to transpose a 2d list in python 
Python :: numpy datetime64 get day 
Python :: python run shell command 
Python :: shutil copyfile python 
Python :: python plot 
Python :: python try catch 
Python :: Django group by date from datetime field 
Python :: find most frequent element in an array python 
Python :: search google images python 
Python :: opencv export image 
Python :: Scaling Operation in SkLearn 
Python :: tkinter progressbar set value 
Python :: update set python 
Python :: how to select python 3 interpreter in linux 
Python :: Python Creating string from a timestamp 
Python :: how to count the number of files in a directory using python 
Python :: path of current working directory with os module python 
Python :: python run command and read output 
Python :: remove element from list python 
Python :: generate new secret key django 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =