Skip to content

Commit 68cdf75

Browse files
Sobhan-SRZAiTsSobhan
and
iTsSobhan
committed
0.0.3
Co-Authored-By: iTsSobhan <99456259+iTsSobhan@users.noreply.github.com>
1 parent c7de2dc commit 68cdf75

File tree

149 files changed

+16270
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+16270
-1
lines changed

config.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
const { ActivityType } = require("discord.js");
2+
module.exports = {
3+
token: process.env.token || "", // Bot token from .env or place in here
4+
prefix: process.env.prefix || "", // Put bot message commands prefix in here.
5+
serverId: process.env.server_id || "", // Put bot main server's id in here.
6+
only_one_guild: false, // Set bot slash command to all guild or just one with placing true or false.
7+
source: {
8+
database: {
9+
type: process.env.database_type || "", // Choose one type for save users and guilds data. Types: "mysql" | "sql" | "mongodb" | "json"
10+
mongoURL: process.env.database_mongoURL || "", // If you choose "mongodb" type place your mongo url.
11+
mysql: {
12+
host: process.env.database_msql_host || "", // Place your Mysql server host name.
13+
user: process.env.database_msql_user || "", // Place your Mysql server username.
14+
password: process.env.database_msql_password || "", // Place your Mysql server password.
15+
database: process.env.database_msql_database || "" // Place your Mysql server database name.
16+
} // If you choose "mysql" type place your Mysql server information.
17+
}
18+
},
19+
status: {
20+
activity: [
21+
"Build by Sobhan-SRZA (mr.sinre)",
22+
"Working in {servers} Servers",
23+
"Work for {members} Members"
24+
], // Set bot status activity, you can change it. | You can use "{members}" variable to shows bot all users.
25+
type: [
26+
ActivityType.Custom
27+
], // Can be: ActivityType.Competing | ActivityType.Listening | ActivityType.Playing | ActivityType.Streaming | ActivityType.Watching
28+
presence: [
29+
"dnd"
30+
] // Can be: "online" | "dnd" | "idle" | "offline"
31+
},
32+
webhook: {
33+
url: process.env.webhook_url || "", // Place a webhook url in here.
34+
username: process.env.webhook_username || "Pc Bot", // Place a name for webhook in here.
35+
avatar: process.env.webhook_avatar || "https://cdn.discordapp.com/avatars/1182394110473150554/f971b4db65d5b6b031106371f70fe2ce.png" // Place a image url in here.
36+
},
37+
owners: [
38+
"865630940361785345",
39+
"986314682547716117",
40+
"866992479328665600"
41+
], // Place bot developers user id in here.
42+
chat_bot: {
43+
name: "Caesar", // Place chat bot name.
44+
gender: "Male" // Place chat bot gender like example: "Male" | "Female"
45+
}
46+
};
47+
/**
48+
* @copyright
49+
* Coded by Sobhan-SRZA (mr.sinre) | https://github.com/Sobhan-SRZA
50+
* @copyright
51+
* Work for Persian Caesar | https://dsc.gg/persian-caesar
52+
* @copyright
53+
* Please Mention Us "Persian Caesar", When Have Problem With Using This Code!
54+
* @copyright
55+
*/

example.env

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# At here place bot token like example:
2+
# token="OTI2bna9qZvCuBu9Nwm7Di4U50y6.Yc1tgA.bNJRNnS1-l537xMkVXlYjgYHK"
3+
token=""
4+
5+
# Place bot message commands prefix in here like example:
6+
# prefix="!"
7+
prefix=""
8+
9+
# Choose one type for save users and guilds data. Types: "mysql" | "sql" | "mongodb" | "json"
10+
# database_type="json"
11+
database_type="json"
12+
13+
# Place bot main server's id in here like example:
14+
# server_id="1054814674979409940"
15+
server_id=""
16+
17+
# Place a webhook url in here like example:
18+
# webhook_url="https://discord.com/api/webhooks/3187212332695885577/nJm_08irrjZOWV2QJ1mnYoa9LEqTQk1VFIdT-A_ue4hvkTvDvo7Z_6mMaGfx2C7G1D7f"
19+
webhook_url=""

index.js

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/**
2+
* @license
3+
BSD 3-Clause License
4+
5+
Copyright (c) 2024, the respective contributors, as shown by Persian Caesar and Sobhan.SRZA (mr.sinre) file.
6+
7+
All rights reserved.
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are met:
11+
12+
* Redistributions of source code must retain the above copyright notice, this
13+
list of conditions and the following disclaimer.
14+
15+
* Redistributions in binary form must reproduce the above copyright notice,
16+
this list of conditions and the following disclaimer in the documentation
17+
and/or other materials provided with the distribution.
18+
19+
* Neither the name of the copyright holder nor the names of its
20+
contributors may be used to endorse or promote products derived from
21+
this software without specific prior written permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
* @returns
34+
*/
35+
// Packages
36+
require("dotenv").config();
37+
const {
38+
Client,
39+
Collection,
40+
Partials,
41+
GatewayIntentBits
42+
} = require("discord.js");
43+
const clc = require("cli-color");
44+
const fs = require("fs");
45+
const post = require("./src/functions/post.js");
46+
const client = new Client({
47+
intents: Object.values(GatewayIntentBits).filter(a => !isNaN(a)),
48+
partials: Object.values(Partials).filter(a => !isNaN(a))
49+
});
50+
const { Player } = require("discord-player");
51+
const { YoutubeiExtractor, generateOauthTokens } = require("discord-player-youtubei");
52+
const { DefaultExtractors } = require("@discord-player/extractor");
53+
const player = new Player(client);
54+
(async () => {
55+
await player.extractors.loadMulti(DefaultExtractors);
56+
await player.extractors.register(YoutubeiExtractor, {
57+
authentication: await generateOauthTokens()
58+
});
59+
})();
60+
client.config = require("./config.js");
61+
client.token = client.config.token;
62+
client.commands = new Collection();
63+
client.cooldowns = new Collection();
64+
65+
// Load Handlers
66+
let amount = 0;
67+
const handle = fs.readdirSync("./src/handlers").filter(file => file.endsWith(".js"));
68+
const data = require("./package.json");
69+
const error = require("./src/functions/error.js");
70+
post(
71+
clc.cyanBright(`Welcome to ${clc.blueBright(data.name)}! | Version: ${clc.blueBright(data.version)}`) + "\n" +
72+
`Coded By ${clc.yellow(`Sobhan-SRZA`)} & ${clc.yellow(`Persian Caesar`)} With ${clc.redBright("❤️")}` + "\n" +
73+
`Discord: ${clc.blueBright(`Mr.Sinre`)} | ${clc.blueBright(`mr.sinre`)} | ${clc.blueBright(`https://dsc.gg/persian-caesar`)}`,
74+
"W",
75+
"magentaBright",
76+
"cyanBright"
77+
);
78+
post(`Logging into the BOT...`, "S", "yellowBright", "greenBright");
79+
handle.forEach((file) => {
80+
require(`./src/handlers/${file}`)(client);
81+
amount += 1;
82+
});
83+
post(`${clc.cyanBright(amount)} Handler Is Loaded!!`, "S", "yellowBright", "greenBright");
84+
85+
// Consol
86+
if (client.token) {
87+
client.login(client.token).catch(e => {
88+
post("The Bot Token You Entered Into Your Project Is Incorrect Or Your Bot's INTENTS Are OFF!!", "E", "red", "redBright");
89+
error(e);
90+
});
91+
} else {
92+
post("Please Write Your Bot Token Opposite The Token In The config.js File In Your Project!!", "E", "red", "redBright");
93+
}
94+
95+
// Anti Crash
96+
process.on("unhandledRejection", (reason) => error(reason));
97+
process.on("rejectionHandled", (promise) => error(promise));
98+
process.on("uncaughtException", (e) => error(e));
99+
process.on("uncaughtExceptionMonitor", (e) => error(e));
100+
/**
101+
* @copyright
102+
* Coded by Sobhan-SRZA (mr.sinre) | https://github.com/Sobhan-SRZA
103+
* @copyright
104+
* Work for Persian Caesar | https://dsc.gg/persian-caesar
105+
* @copyright
106+
* Please Mention Us "Persian Caesar", When Have Problem With Using This Code!
107+
* @copyright
108+
*/

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "all-for-one-bot",
3+
"version": "0.0.3",
4+
"description": "This discord bot have some featrues like mini games for members, auto reaction and utility options for admins.",
5+
"main": "index.js",
6+
"license": "BSD-3-Clause",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"start": "node index.js"
10+
},
11+
"dependencies": {
12+
"@discord-player/extractor": "^7.0.0-dev.4",
13+
"@napi-rs/canvas": "^0.1.45",
14+
"axios": "^1.6.7",
15+
"cli-color": "^2.0.3",
16+
"discord-api-types": "^0.37.101",
17+
"discord-gamecord": "^4.4.1",
18+
"discord-player": "^7.0.0-dev.4",
19+
"discord-player-youtubei": "^1.3.7",
20+
"discord-tictactoe": "^4.2.0",
21+
"discord.js": "^14.15.3",
22+
"dotenv": "^16.3.1",
23+
"ffmpeg-static": "^5.2.0",
24+
"gradio-chatbot": "^0.0.28",
25+
"jalali-moment": "^3.3.11",
26+
"jimp": "^0.22.10",
27+
"mediaplex": "^1.0.0",
28+
"prism-media": "^1.3.5",
29+
"quick.db": "^9.1.7",
30+
"write-file-atomic": "^5.0.1",
31+
"youtube-ext": "^1.1.25"
32+
}
33+
}

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ This source is full discord bot and can do anything you want.
5050
<img alt="My Discord Account" src="https://discord.c99.nl/widget/theme-1/865630940361785345.png" />
5151
</a>
5252
</div>
53-
</div>
53+
</div>

src/commands/Admins/clear.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
const {
2+
EmbedBuilder,
3+
ChannelType,
4+
ApplicationCommandType,
5+
ApplicationCommandOptionType
6+
} = require("discord.js");
7+
const error = require("../../functions/error");
8+
module.exports = {
9+
name: "clear",
10+
description: "پاک کردن پیام بیشتر از 100 نمیشود",
11+
category: "admin",
12+
type: ApplicationCommandType.ChatInput,
13+
user_permissions: ["ManageMessages"],
14+
bot_permissions: ["SendMessages", "EmbedLinks"],
15+
dm_permissions: false,
16+
only_owner: false,
17+
only_admin: false,
18+
only_slash: true,
19+
only_message: false,
20+
options: [{
21+
name: "amount",
22+
description: "تعداد پاک کردن ",
23+
type: ApplicationCommandOptionType.String,
24+
required: false
25+
}, {
26+
name: "channel",
27+
description: "چنلی ک میخوای پیاماشو پاک کنی ",
28+
type: ApplicationCommandOptionType.Channel,
29+
channelTypes: [ChannelType.GuildText],
30+
required: false
31+
}],
32+
33+
34+
/**
35+
*
36+
* @param {import("discord.js").Client} client
37+
* @param {import("discord.js").CommandInteraction} interaction
38+
* @param {Array<string>} args
39+
* @returns
40+
*/
41+
run: async (client, interaction) => {
42+
let channel = interaction.options.getChannel("channel") || interaction.channel;
43+
let amount = interaction.options.getString("amount") || 100;
44+
try {
45+
if (isNaN(amount)) {
46+
interaction.reply({
47+
content: `❌| لطفا تعداد بگو`,
48+
ephemeral: true,
49+
})
50+
}
51+
const embed = new EmbedBuilder()
52+
.setColor("Yellow")
53+
.setTitle(`⚖️| Clear Information`)
54+
.addFields({
55+
name: `چنل`,
56+
value: `${channel}`,
57+
inline: true
58+
}, {
59+
name: `پاک شده توسط`,
60+
value: `${interaction.user}`,
61+
inline: true
62+
})
63+
.setTimestamp();
64+
65+
await channel.bulkDelete(amount, true).then(async (msg) => {
66+
embed.addFields({ name: `تعداد پیام های پاک شده`, value: `${msg.size}`, inline: true })
67+
if (msg.size === 0) {
68+
interaction.reply({
69+
content: `**❌| پیامی برای پاک کردن پیدا نشد**`,
70+
ephemeral: true
71+
})
72+
}
73+
return await interaction.reply({
74+
embeds: [embed],
75+
ephemeral: true,
76+
})
77+
})
78+
} catch (e) {
79+
error(e)
80+
}
81+
}
82+
};
83+
/**
84+
* @copyright
85+
* Coded by Sobhan-SRZA (mr.sinre) | https://github.com/Sobhan-SRZA
86+
* @copyright
87+
* Work for Persian Caesar | https://dsc.gg/persian-caesar
88+
* @copyright
89+
* Please Mention Us "Persian Caesar", When Have Problem With Using This Code!
90+
* @copyright
91+
*/

0 commit comments

Comments
 (0)