Python found

Asked 2 years ago, Updated 2 years ago, 136 views

message_content = message.content
ban = message_content.found ("test")

I'm making a bot in Discord I want to make several test phrases, what should I do?

find python

2022-09-20 19:04

2 Answers

You can just add it.

message_content = message.content
ban = message_content.find("A")
ban2 = message_content.find ("me")
ban3 = message_content.find("Da")


2022-09-20 19:04

message_content = 'Ganada Ramaba Pad Lipsa'
ban_keyword_list = ["Test 1", "Cursing", "Pad lip", "Other etc"]

if any(keyword in message_content for keyword in ban_keyword_list):
    print (f'User used the Prohibited Keyword

The any function is a Python default built-in function. It receives an iterable datatype as a factor.

Returns True if there is only one True element of the factor.


2022-09-20 19:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.