├── LICENSE
├── README.md
├── apply.js
├── config.json
├── index.js
├── package-lock.json
├── package.json
├── server.js
└── webserver.py
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 2-Clause License
2 |
3 | Copyright (c) 2021, captain motchy
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Discord application bot
4 |
5 | [](https://discord.gg/9ZrzNkzeN4)
6 | [](https://discord.gg/9ZrzNkzeN4)
7 | [](https://discord.gg/9ZrzNkzeN4)
8 | [](https://discord.gg/9ZrzNkzeN4)
9 | [](https://discord.gg/9ZrzNkzeN4)
10 | [](https://discord.gg/9ZrzNkzeN4)
11 | [](https://discord.gg/9ZrzNkzeN4)
12 | [](https://discord.gg/9ZrzNkzeN4)
13 |
14 | [](https://www.youtube.com/channel/UCmkPzf-eAJsiuCh-5kz4Abw)
15 |
16 | ## Features
17 | * **Watch my YT video & host your bot 24/7**
18 | * Easy to run
19 | * Fast loading
20 | * No external keys needed (besides a Discord Bot token)
21 | * Smooth application
22 | * Clean and beautiful apply's
23 |
24 | ## Up to 500 questions
25 |
26 | 
27 |
28 |
29 | ## Made with ❤️ and javascript
30 |
31 | 
32 |
33 | ## Installation
34 |
35 |
36 | ### Click [here](https://www.youtube.com/channel/UCmkPzf-eAJsiuCh-5kz4Abw) to watch my YouTube video !
37 |
38 |
39 | ### Click [here](https://dsc.gg/dst74) to join my discord server !
40 |
41 | 
42 |
--------------------------------------------------------------------------------
/apply.js:
--------------------------------------------------------------------------------
1 | const Discord = require('discord.js')
2 |
3 | const client = new Discord.Client()
4 |
5 | const config = require('./config.json')
6 |
7 | client.on('ready', () => {
8 | console.log(`${client.user.tag} is online!`)
9 |
10 | })
11 |
12 | client.on('message', async message => {
13 |
14 | let args = message.content.slice(config.prefix.length).trim().split(/ +/)
15 | let command = args.shift().toLowerCase()
16 |
17 |
18 | let questions = {
19 | firstQuestion: "Are you familiar with Github ? ``Yes/No``",
20 | secondQuestion: "How long are you online a day ?",
21 | thirdQuestion: "When you get stuck on a problem, what do you do ?",
22 | fourthQuestion: "How old are you ?",
23 | fifthQuestion: "Are you ready to work in a team and move it forward in a meaningful way ? ``Yes/No``",
24 | }
25 |
26 |
27 | if (!message.content.startsWith(config.prefix) || message.author.bot) return
28 | if (command === "apply") {
29 | message.channel.send("I have started this process in your DM's. Type `cancel` to cancel")
30 | message.author.send(questions.firstQuestion).then(msg => {
31 | const filter1 = m => m.author.id === message.author.id
32 | msg.channel.awaitMessages(filter1, {
33 | time: 5 * 60000,
34 | max: 1
35 | }).then(messages => {
36 | let msg1 = messages.first().content
37 | if(msg1.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
38 | message.author.send(questions.secondQuestion).then(msg => {
39 | const filter1 = m => m.author.id === message.author.id
40 | msg.channel.awaitMessages(filter1, {
41 | time: 5 * 60000,
42 | max: 1
43 | }).then(messages => {
44 | let msg2 = messages.first().content
45 | if(msg2.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
46 | message.author.send(questions.thirdQuestion).then(msg => {
47 | const filter1 = m => m.author.id === message.author.id
48 | msg.channel.awaitMessages(filter1, {
49 | time: 5 * 60000,
50 | max: 1
51 | }).then(messages => {
52 | let msg3 = messages.first().content
53 | if(msg3.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
54 | message.author.send(questions.fourthQuestion).then(msg => {
55 | const filter1 = m => m.author.id === message.author.id
56 | msg.channel.awaitMessages(filter1, {
57 | time: 5 * 60000,
58 | max: 1
59 | }).then(messages => {
60 | let msg4 = messages.first().content
61 | if(msg4.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
62 | message.author.send(questions.fifthQuestion).then(msg => {
63 | const filter1 = m => m.author.id === message.author.id
64 | msg.channel.awaitMessages(filter1, {
65 | time: 5 * 60000,
66 | max: 1
67 | }).then(messages => {
68 | let msg5 = messages.first().content
69 | if(msg5.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
70 | message.author.send("Subbmitted application! ``made by captain motchy``").then(msg => {
71 | message.client.channels.cache.get(config.applicationChannel).send(
72 | new Discord.MessageEmbed()
73 | .setTitle('Application Submitted')
74 | .setDescription(`This application was submitted by ${message.author.tag} (${message.author.id}).\nCreated: ${message.author.createdAt}`)
75 | .addField(questions.firstQuestion, "Answer: " + msg1)
76 | .addField(questions.secondQuestion, "Answer: " + msg2)
77 | .addField(questions.thirdQuestion, "Answer: " + msg3)
78 | .addField(questions.fourthQuestion, "Answer: " + msg4)
79 | .addField(questions.fifthQuestion, "Answer: " + msg5)
80 | )
81 | })
82 | })
83 | })
84 | })
85 | })
86 | })
87 | })
88 | })
89 | })
90 | })
91 | })
92 | }
93 |
94 | if(command === "decline"){
95 | if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("you dont' have permission to use this command")
96 | let User = message.mentions.users.first()
97 | if(!User) return message.channel.send("Please provide a user for me to decline")
98 | User.send("Your application to " + message.guild.name + " got declined by: " + message.author.tag)
99 | }
100 |
101 | if(command === "accept"){
102 | if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("you dont' have permission to use this command")
103 | let User = message.mentions.users.first()
104 | if(!User) return message.channel.send("Please provide a user for me to accept")
105 | User.send(":tada: Your application to " + message.guild.name + " got accepted by: " + message.author.tag)
106 | }
107 | })
108 |
109 | client.login(config.token)
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "token":"xxx",
3 | "prefix":"xxx",
4 | "applicationChannel":"xxx"
5 | }
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 |
2 | const { Client } = require("discord.js");
3 | const keepAlive = require('./server.js');
4 |
5 | const client = new Client({
6 | disableEveryone: true
7 | });
8 |
9 | keepAlive();
10 | client.login(process.env.TOKEN);
11 |
12 |
13 |
14 | const config = require('./config.json')
15 | const Discord = require('discord.js')
16 |
17 | client.on('ready', () => {
18 | console.log(`${client.user.tag} is online!`)
19 |
20 | })
21 |
22 | client.on('message', async message => {
23 |
24 | let args = message.content.slice(config.prefix.length).trim().split(/ +/)
25 | let command = args.shift().toLowerCase()
26 |
27 |
28 | let questions = {
29 | firstQuestion: "Are you familiar with Github ? ``Yes/No``",
30 | secondQuestion: "How long are you online a day ?",
31 | thirdQuestion: "When you get stuck on a problem, what do you do ?",
32 | fourthQuestion: "How old are you ?",
33 | fifthQuestion: "Are you ready to work in a team and move it forward in a meaningful way ? ``Yes/No``",
34 | }
35 |
36 |
37 | if (!message.content.startsWith(config.prefix) || message.author.bot) return
38 | if (command === "apply") {
39 | message.channel.send("I have started this process in your DM's. Type `cancel` to cancel")
40 | message.author.send(questions.firstQuestion).then(msg => {
41 | const filter1 = m => m.author.id === message.author.id
42 | msg.channel.awaitMessages(filter1, {
43 | time: 5 * 60000,
44 | max: 1
45 | }).then(messages => {
46 | let msg1 = messages.first().content
47 | if(msg1.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
48 | message.author.send(questions.secondQuestion).then(msg => {
49 | const filter1 = m => m.author.id === message.author.id
50 | msg.channel.awaitMessages(filter1, {
51 | time: 5 * 60000,
52 | max: 1
53 | }).then(messages => {
54 | let msg2 = messages.first().content
55 | if(msg2.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
56 | message.author.send(questions.thirdQuestion).then(msg => {
57 | const filter1 = m => m.author.id === message.author.id
58 | msg.channel.awaitMessages(filter1, {
59 | time: 5 * 60000,
60 | max: 1
61 | }).then(messages => {
62 | let msg3 = messages.first().content
63 | if(msg3.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
64 | message.author.send(questions.fourthQuestion).then(msg => {
65 | const filter1 = m => m.author.id === message.author.id
66 | msg.channel.awaitMessages(filter1, {
67 | time: 5 * 60000,
68 | max: 1
69 | }).then(messages => {
70 | let msg4 = messages.first().content
71 | if(msg4.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
72 | message.author.send(questions.fifthQuestion).then(msg => {
73 | const filter1 = m => m.author.id === message.author.id
74 | msg.channel.awaitMessages(filter1, {
75 | time: 5 * 60000,
76 | max: 1
77 | }).then(messages => {
78 | let msg5 = messages.first().content
79 | if(msg5.toLowerCase() === "cancel") return message.author.send("Ok, I have cancelled this process")
80 | message.author.send("Subbmitted application! ``made by captain motchy``").then(msg => {
81 | message.client.channels.cache.get(config.applicationChannel).send(
82 | new Discord.MessageEmbed()
83 | .setTitle('Application Submitted')
84 | .setDescription(`This application was submitted by ${message.author.tag} (${message.author.id}).\nCreated: ${message.author.createdAt}`)
85 | .addField(questions.firstQuestion, "Answer: " + msg1)
86 | .addField(questions.secondQuestion, "Answer: " + msg2)
87 | .addField(questions.thirdQuestion, "Answer: " + msg3)
88 | .addField(questions.fourthQuestion, "Answer: " + msg4)
89 | .addField(questions.fifthQuestion, "Answer: " + msg5)
90 | )
91 | })
92 | })
93 | })
94 | })
95 | })
96 | })
97 | })
98 | })
99 | })
100 | })
101 | })
102 | }
103 |
104 | if(command === "decline"){
105 | if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("you dont' have permission to use this command")
106 | let User = message.mentions.users.first()
107 | if(!User) return message.channel.send("Please provide a user for me to decline")
108 | User.send("Your application to " + message.guild.name + " got declined by: " + message.author.tag)
109 | }
110 |
111 | if(command === "accept"){
112 | if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("you dont' have permission to use this command")
113 | let User = message.mentions.users.first()
114 | if(!User) return message.channel.send("Please provide a user for me to accept")
115 | User.send(":tada: Your application to " + message.guild.name + " got accepted by: " + message.author.tag)
116 | }
117 | })
118 |
119 | client.login(config.token)
120 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "application-bot",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@discordjs/collection": {
8 | "version": "0.1.6",
9 | "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz",
10 | "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ=="
11 | },
12 | "@discordjs/form-data": {
13 | "version": "3.0.1",
14 | "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
15 | "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
16 | "requires": {
17 | "asynckit": "^0.4.0",
18 | "combined-stream": "^1.0.8",
19 | "mime-types": "^2.1.12"
20 | }
21 | },
22 | "abort-controller": {
23 | "version": "3.0.0",
24 | "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
25 | "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
26 | "requires": {
27 | "event-target-shim": "^5.0.0"
28 | }
29 | },
30 | "asynckit": {
31 | "version": "0.4.0",
32 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
33 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
34 | },
35 | "combined-stream": {
36 | "version": "1.0.8",
37 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
38 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
39 | "requires": {
40 | "delayed-stream": "~1.0.0"
41 | }
42 | },
43 | "delayed-stream": {
44 | "version": "1.0.0",
45 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
46 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
47 | },
48 | "discord.js": {
49 | "version": "12.5.1",
50 | "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.1.tgz",
51 | "integrity": "sha512-VwZkVaUAIOB9mKdca0I5MefPMTQJTNg0qdgi1huF3iwsFwJ0L5s/Y69AQe+iPmjuV6j9rtKoG0Ta0n9vgEIL6w==",
52 | "requires": {
53 | "@discordjs/collection": "^0.1.6",
54 | "@discordjs/form-data": "^3.0.1",
55 | "abort-controller": "^3.0.0",
56 | "node-fetch": "^2.6.1",
57 | "prism-media": "^1.2.2",
58 | "setimmediate": "^1.0.5",
59 | "tweetnacl": "^1.0.3",
60 | "ws": "^7.3.1"
61 | }
62 | },
63 | "event-target-shim": {
64 | "version": "5.0.1",
65 | "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
66 | "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
67 | },
68 | "mime-db": {
69 | "version": "1.44.0",
70 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
71 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
72 | },
73 | "mime-types": {
74 | "version": "2.1.27",
75 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
76 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
77 | "requires": {
78 | "mime-db": "1.44.0"
79 | }
80 | },
81 | "node-fetch": {
82 | "version": "2.6.1",
83 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
84 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
85 | },
86 | "prism-media": {
87 | "version": "1.2.3",
88 | "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz",
89 | "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A=="
90 | },
91 | "setimmediate": {
92 | "version": "1.0.5",
93 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
94 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
95 | },
96 | "tweetnacl": {
97 | "version": "1.0.3",
98 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
99 | "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
100 | },
101 | "ws": {
102 | "version": "7.4.0",
103 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz",
104 | "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ=="
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "application-bot",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "discord.js": "^12.5.1"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const server = express();
3 |
4 | server.all('/', (req, res) => {
5 | res.send(`OK`)
6 | })
7 |
8 | function keepAlive() {
9 | server.listen(3000, () => { console.log("Server is Ready!!" + Date.now()) });
10 | }
11 |
12 | module.exports = keepAlive;
--------------------------------------------------------------------------------
/webserver.py:
--------------------------------------------------------------------------------
1 | from flask import Flask
2 |
3 | from threading import Thread
4 |
5 |
6 |
7 | app = Flask('')
8 |
9 |
10 |
11 | @app.route('/')
12 |
13 | def home():
14 |
15 | return "I'm alive"
16 |
17 |
18 |
19 | def run():
20 |
21 | app.run(host='0.0.0.0',port=8080)
22 |
23 |
24 |
25 | def keep_alive():
26 |
27 | t = Thread(target=run)
28 |
29 | t.start()
--------------------------------------------------------------------------------