Simple Discord Bot that uses discord modals to create applications like Google Forms.
- Go to Discord Developers website, login into your account and create a New Application.
- Select the name that you want for your application (not discord bot).
- Then, go to Bot section and click Add Bot -> Yes, do it! button.
- Once created your bot, go to OAuth2 -> URL Generator section.
- For the application scopes, select bot and application.commands.
- Then, select the permissions that the bot needs.
- Once selected your bot permissions, just click on Copy button.
- Open a new tab on your web browser and paste the link.
- Select the server that you want to invite the bot.
- Go again to Bot section and click Reset Token -> Yes, do it!.
- Then click Copy and that's your bot's token DO NOT SHARE.
If you did that steps correctly, the bot should have joined the server that you selected and should appear offline.
- Ensure that you have Python 3.10, pip and git installed in the machine that the bot is gonna run.
- Clone the repository using
git clone https://github.com/KillerCrazy25/DiscordForms
or just download it. - Then install all the requirements with the command below:
Linux / Mac OS python3 -m pip install -r requirements.txt Windows python -m pip install -r requirements.txt
Ensure that you have developer mode enabled on discord. (That's gonna be useful because you will be able to copy guild ids, channel ids, etc.)
RENAME ALL .example.json
TO .json
.
- Rename .example.env to .env.
- Open that file with any text editor and write the next text:
TOKEN=PASTE_HERE_YOUR_BOT_TOKEN_THAT_YOU_GOT_FROM_DISCORD_DEVELOPERS_WITHOUT_QUOTES
.
prefix
-> The prefix you would like to use when running commands.guild_ids
-> Paste there your server id. That's for slash commands faster loading.questions_timeout
-> The time that the user needs to answer$config
questions.confirmation_timeout
-> The time that the user needs to click the$config
confirmation buttons.admin_role_id
-> The role that is needed to execute bot's admin commands. Paste there the ID of the role.
If you don't know JSON syntax, it's better to configure the bot using the $config
command.**
app_title
-> The title of discord modal (form).app_custom_id
-> The custom of discord modal (form).button_name
-> The name of the button that's gonna open the form to the user that clicked it.embed_name
-> The name of the embed that contains the button explained before.embed_description
-> The description of the embed that contains the button explained before.submit_channel_id
-> The channel that the bot is gonna send the application answers. Paste there the ID of the channel.
Questions config field is a List, so if you want to change the questions via JSON File, PLEASE FOLLOW THE CORRECT SYNTAX
-
questions
-> For every question, add the rows below:question
-> The question that you want to ask in your application.placeholder
-> The placeholder that your answer field is gonna have.required
-> The answer is necessary to submit the application?style
-> The style of the answer field.input_style
-> If the row above isinput
, select the type of input of your answer field.custom_id
-> The custom id of your question.
To run the bot you need to run the following command:
Linux / Mac OS
python3 bot.py
Windows
python bot.py
For contributing, please read this article