Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

send message if user is banned discord.py

@commands.Cog.listener()
async def on_member_remove(self, member):
    channel = self.bot.get_channel(805991434330570793)
    try:
        banned = await member.guild.fetch_ban(member)
    except discord.NotFound:
        banned = False
    if banned:
        await channel.send(f"{member} was just banned from the server.")
    else:
        await channel.send(f"{member} just left the server.")
Comment

PREVIOUS NEXT
Code Example
Python :: pandas sort 
Python :: remove all integers from list python 
Python :: python fill 0 
Python :: pandas groupby percentile 
Python :: ipython.display install 
Python :: python get directory of current script file 
Python :: pyttsx3 female voice template 
Python :: how to take multiple input in list in python 
Python :: python - remove duplicate items from the list 
Python :: strptime 
Python :: python regex get string before character 
Python :: django file upload this field is required 
Python :: python csv to list 
Python :: should i make tkinter in classes ? , Best way to structure a tkinter application? 
Python :: python reverse split only once 
Python :: smtplib not sending email 
Python :: python os open notepad 
Python :: Simple pagination wrapper for discord.py. 
Python :: numpy normalize 
Python :: how to return an html file in flask 
Python :: python range of letters 
Python :: set title matplotlib 
Python :: get pixel color pygame 
Python :: normal distribution in python 
Python :: plotly heatmap with label 
Python :: flip key and value in dictionary python 
Python :: create dictionary from input python 
Python :: csrf token fetch django 
Python :: factorial in python 
Python :: create or update django models 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =