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 :: pyqt curves exemple 
Python :: How to know position on Kivy 
Python :: imitate meaning 
Python :: mostFrequentDays python 
Python :: &quot;Token&quot; is not defined Pylance 
Python :: loop through dataframe and assign values based on previous row 
Python :: capitalise.texts 
Python :: variable types in python 
Python :: python remove title from name 
Python :: sort vs sorted python 
Python :: 10.4.1.3. return Terminates Function Execution 
Python :: geopandas clipping 
Python :: convert darkflow yolov3 tensorflow lite 
Python :: connect two mathod to the same button in pyq5 
Python :: add a third dimension matrix dataset python 
Python :: first hitting time python 
Python :: np.argmax python could not be evaluated 
Python :: installing intelpython3_core using anaconda 
Python :: 2600/6 
Python :: bar chart with x-ticks 
Python :: Separating a relational plot based on a sixth variable | seaborn relational plot 
Python :: fibonacci series program in python 
Python :: pandas check if column type is list 
Python :: xlabel font size python latex 
Python :: access kwargs in template django 
Python :: python find if strings have common substring 
Python :: finda argument index 
Python :: how to run function when file is modified python 
Python :: !value in python 
Python :: # multithreading for optimal use of CPU 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =