E
E
Ender_man9672021-06-06 14:16:29
Python
Ender_man967, 2021-06-06 14:16:29

How to write an input for a discord bot?

I'm writing a discord bot.
If I write input('How many times to do this') then it will be asked in the console, but I need it to be asked in the discord chat. How to do it? Programming in python 3.6.5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-06-06
@Ender_man967

A simple option is command parameters. In other words, you set all the initial data for executing the command in one initial message.
For example,
> You: !say 3 Hello
< Bot: Hello
< Bot: Hello
< Bot: Hello
If you're using discord.py, it provides a very handy mechanism for this sort of thing. It is described in detail in the documentation .
Difficult option - step by step / dialog.
Then you will have to remember for each user what step he is on, and process incoming messages depending on the current step.
Basically, it is a state machine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question