“Cara Membuat Python Bot Moderasi Perselisihan” Kode Jawaban

Cara Membuat Python Bot Moderasi Perselisihan

#You can solve your problem like this:

@client.event
async def on_message(message):
	if "your word" in str.lower(message.content):
    	await message.delete()

#This programm makes the message into all lowercase letters. 
#just be carefull, your word that you want to be deleted has to be written in all lowercase letters too.

#if you want to look if an element is in a list do:
bad_words = ["test", "bad", "word"]

@client.event
async def on_message(message):
	for word in bad_words:
		if word in str.lower(message.content):
    		await message.delete()
Gleaming Giraffe

Cara Membuat Python Bot Moderasi Perselisihan

how do i make it so it takes capitals like FUCK it wont delete but if i add that to word list things like fUck wont delete cus capital U
Testy Tuatara

Cara Membuat Python Bot Moderasi Perselisihan

# for higher letters

@client.event
async def on_message(message):
	for word in bad_words:
		if word in str.higher(message.content):
    		await message.delete()
Hanz_Holu

Jawaban yang mirip dengan “Cara Membuat Python Bot Moderasi Perselisihan”

Pertanyaan yang mirip dengan “Cara Membuat Python Bot Moderasi Perselisihan”

Lebih banyak jawaban terkait untuk “Cara Membuat Python Bot Moderasi Perselisihan” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya