By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,914 Members | 572 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,914 IT Pros & Developers. It's quick & easy.

discord question answering bot using keywords

P: 3
I am trying to make a bot that checks a message for a key word then answers the question in the same channel. So far I have to have the exact phrase when I use
elif message.content.startswith('how do I do this')
is there a way I could detect one of the words in the string
4 Weeks Ago #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 311
There's an 'in' keyword. Also the 'find()' function.
4 Weeks Ago #2

P: 3
how would I write that in this instance?
It is an answer bot for discord and it is checking a channel message for a word to give an answer....without the bot ansering its self in a loop. the way I was doing it was only if I get exact phrase using this.
elif message.content.startswith('invite'):
if == client.user: return
help_channel = client.get_channel(756997924524654613)
await help_channel.send('To invite someone to this server you need to be a verified member. go to Welcome channel to get verified')
but this prevented any other questions working.
4 Weeks Ago #3

P: 3
elif message.content.startswith('how do I change my morphs'):
help_channel = client.get_channel(756997924524654613)
await help_channel.send('To change your morphs go to the shrine of Stendarr in Elden Root Grahtwood and make a donation')
This was the way I did it but tried the one above to no luck.
4 Weeks Ago #4

Post your reply

Sign in to post your reply or Sign up for a free account.