473,503 Members | 11,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

discord question answering bot using keywords

3 New Member
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
Sep 21 '20 #1
5 11248
dev7060
639 Recognized Expert Contributor
There's an 'in' keyword. Also the 'find()' function.
Sep 21 '20 #2
DragonHawk
3 New Member
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 message.author == 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.
Sep 22 '20 #3
DragonHawk
3 New Member
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.
Sep 22 '20 #4
redereds
1 New Member
Could you share your code completely? I don't see any mistake in the passage you published. The "find" operator should perform a keyword search function in theory. However, unfortunately, I'm not that good at bots. Therefore, I think you should read more about Discord bots and look at code examples to find an error in your own.
Feb 25 '22 #5
BernieLS
1 New Member
First of all, thank you for posting your question here...

Recently I was reading an article about creating an app for discord from scratch. So I thought this might help you while creating a new simple bot for discord.

Thanks again,

Article - Building a Simple Bot for Discord
Feb 28 '22 #6

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

Similar topics

4
4388
by: Nel | last post by:
Hi all, Before I re-invent the wheel here, has anyone willing to share a basic script to extract META keywords from a string. I have a string, let's say $pageText that contains the dynamic...
9
1828
by: Nathan Sokalski | last post by:
I am trying to do a database search using LIKE using the following code: Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click If...
5
4170
by: JP SIngh | last post by:
Hi All This is a complicated one, not for the faint hearted :) :) :) Please help if you can how to achieve this search. We have a freetext search entry box to allow users to search the...
9
3366
by: Nenad Loncarevic | last post by:
I am a geologist, and over the years I've accumulated quite a number of proffesional papers on the subject, in various publications. I would like to make a database that would help me find the...
2
1817
by: alnoir | last post by:
I've looked around online and have even had a friend help me, however, for some reason I can't compare two strings. I'm doing this at the end of the code (within the two foreach loops), above...
5
11908
by: mforema | last post by:
Hi Everyone, I want to search records by typing in multiple keywords. I currently have a search form. It has a combo box, text box, Search command button, and a subform. The combo box lists the...
7
3376
by: Maximus Decimus | last post by:
HI all, I am using python v2.5 and I am an amateur working on python. I am extending python for my research work and would like some help and guidance w.r.t this matter from you experienced...
1
3622
by: rciiipo | last post by:
I have a question that is similar to a thread started by pauljhorak; however, my needs are a bit different / possibly more complicated. I have several files stored as outlook items (.msg). I...
0
775
by: venkatesh123 | last post by:
I need to read particular portion of the pdf files using keywords..how can this possible?..thanks in advance
0
7193
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.