Skip to content

Commit 3c3d69e

Browse files
committed
[5.0] Úpravy a mazání zápisů
- Přidána podpora pro úpravu služeb a omluvenek, pomocí tlačítek pod zprávou - Přidána podpora pro smazání služeb a omluvenek, pomocí tlačítek pod zprávou - Možnost zápisu příkazem použitým i mimo vlastní složku - Drobné úpravy
1 parent 518f42a commit 3c3d69e

14 files changed

+391
-368
lines changed

assets/icon-CID.png

-6.34 MB
Binary file not shown.

assets/icon-SAHP.png

-2.96 MB
Binary file not shown.

db/LSCSO/000000000000000001.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"id": "1194666261259501598",
2222
"removed": false,
2323
"shared": "2. 7. 2020",
24+
"eventID": 0,
2425
"start": "3. 7. 2020",
2526
"end": "7. 7. 2020",
2627
"ooc": "Rodinná akce",

db/LSPD/000000000000000001.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"id": "1194666261259501598",
2323
"removed": false,
2424
"shared": "2. 7. 2020",
25+
"eventID": 0,
2526
"start": "3. 7. 2020",
2627
"end": "7. 7. 2020",
2728
"ooc": "Rodinná akce",

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ bot.LEA = {
3939
duty: "#5245c0",
4040
apology: "#c05245",
4141
summary: "#25be5c",
42-
event: "#Be25ab"
42+
event: "#Be25ab",
43+
deleted: "#c43136"
4344
},
4445
i: {
4546
LEAbot: "https://i.imgur.com/EnZErOi.png",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lea-bot",
3-
"version": "4.9.2",
3+
"version": "5.0",
44
"description": "RefreshRP (FiveM GTA V roleplay) Discord bot for LEA - making internal police department actions easier.",
55
"type": "module",
66
"main": "index.js",

src/commands/duty.js

-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ export const slash = new SlashCommandBuilder()
88
.setNSFW(false);
99

1010
export default async function run(bot, i) {
11-
const folders = ["1213984576100241419", "1203743211000963082"];
12-
let folder;
13-
if (getServer(i.guild.id).id === 2) folder = folders[1];
14-
else if (getServer(i.guild.id).id === 1) folder = folders[0];
15-
else return i.reply({ content: "> 🛑 **Neznámý server!**", ephemeral: true });
16-
if (!i.channel.isThread()) return i.reply({ content: `> 🛑 **Zápis __duties__ a __omluvenek__ je povolen pouze ve své složce, ve <#${folder}>.**`, ephemeral: true });
17-
if (!folders.includes(i.channel.parentId)) return i.reply({ content: `> 🛑 **Zápis __duties__ a __omluvenek__ je povolen pouze ve své složce, v <#${folder}>.**`, ephemeral: true });
18-
1911
const modal = new ModalBuilder()
2012
.setCustomId("dutyModal")
2113
.setTitle("LEA | Zápis služby");

src/commands/menu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default async function run(bot, i) {
8181
])
8282
.setColor(bot.LEA.c.LEAbot)
8383
.setThumbnail(bot.user.avatarURL())
84-
.setFooter({ text: `LEA Bot v${process.env.version} | Vytvořil b1ngo 🎈`, iconURL: bot.user.avatarURL() });
84+
.setFooter({ text: `LEA Bot v${process.env.version} | Vytvořil b1ngo ✏️`, iconURL: bot.user.avatarURL() });
8585

8686
let group;
8787
if (bot.LEA.g.LSPD.includes(i.guild.id)) group = "**LSPD** " + bot.LEA.e.LSPD;

src/events/interactionCreate.js

+371-331
Large diffs are not rendered by default.

src/functions/db.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ export function getServer(guildID) {
4444

4545
if (bot.LEA.g.LSPD.includes(guildID)) {
4646
r.name = "LSPD"
47-
r.footer = { text: `LSPD | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i.LSPD };
47+
r.footer = { text: `LSPD | LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i.LSPD };
4848
r.color = bot.LEA.c.LSPD;
4949
r.id = 1;
5050
} else if (bot.LEA.g.LSCSO.includes(guildID)) {
5151
r.name = "LSCSO"
52-
r.footer = { text: `LSCSO | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i.LSCSO };
52+
r.footer = { text: `LSCSO | LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i.LSCSO };
5353
r.color = bot.LEA.c.LSCSO;
5454
r.id = 2;
5555
} else {
5656
r.name = "XXXX"
57-
r.footer = { text: `LEA-Bot | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i.LEAbot };
57+
r.footer = { text: `LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i.LEAbot };
5858
r.color = bot.LEA.c.LEAbot;
5959
r.id = 0;
6060
}

src/functions/logSystem.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function dcLog(bot, guildID, member, options = {}) {
8484
.setTitle(title)
8585
.setDescription(description)
8686
.setColor(color)
87-
.setFooter({ text: "LSPD | Vytvořil b1ngo 🎈", iconURL: bot.LEA.i.LSPD });
87+
.setFooter({ text: "LSPD | LEA-Bot v${process.env.version} by b1ngo ✏️", iconURL: bot.LEA.i.LSPD });
8888
await channel.send({ embeds: [logEmbed], files: files });
8989
} else if (gotServer.id === 2) {
9090
let files = [];
@@ -97,7 +97,7 @@ export async function dcLog(bot, guildID, member, options = {}) {
9797
.setTitle(title)
9898
.setDescription(description)
9999
.setColor(color)
100-
.setFooter({ text: "LSCSO | Vytvořil b1ngo 🎈", iconURL: bot.LEA.i.LSCSO });
100+
.setFooter({ text: "LSCSO | LEA-Bot v${process.env.version} by b1ngo ✏️", iconURL: bot.LEA.i.LSCSO });
101101
await channel.send({ embeds: [logEmbed], files: files });
102102
}
103103
}

src/functions/newSystem.js

+7-19
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default async function folders(bot) {
5151
)
5252
.setThumbnail(bot.LEA.i.SAHP)
5353
.setColor(bot.LEA.c.SAHP)
54-
.setFooter({ text: `SAHP | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i.SAHP });
54+
.setFooter({ text: `SAHP | LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i.SAHP });
5555
const row = new ActionRowBuilder()
5656
.addComponents(
5757
new ButtonBuilder()
@@ -73,16 +73,6 @@ export default async function folders(bot) {
7373
worker.folder = folder.id;
7474
for (const apology of worker.apologies) {
7575
const index = worker.apologies.indexOf(apology);
76-
/*const row = new ActionRowBuilder()
77-
.addComponents(
78-
new ButtonBuilder()
79-
.setCustomId("editButton")
80-
.setLabel("Přepsat")
81-
.setDisabled()
82-
.setStyle(ButtonStyle.Primary)
83-
.setEmoji("📝")
84-
.setDisabled(),
85-
);*/
8676

8777
const apologyEmbed = new EmbedBuilder()
8878
.setAuthor({ name: member.displayName, iconURL: member.displayAvatarURL() })
@@ -100,7 +90,7 @@ export default async function folders(bot) {
10090
])
10191
.setThumbnail("https://i.imgur.com/YQb9mPm.png")
10292
.setColor(bot.LEA.c.apology)
103-
.setFooter({ text: `SAHP | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i.SAHP });
93+
.setFooter({ text: `SAHP | LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i.SAHP });
10494

10595
const msg = await folder.send({ embeds: [apologyEmbed]/*, components: [row]*/ });
10696
worker.apologies[index].id = msg.id;
@@ -115,24 +105,22 @@ export default async function folders(bot) {
115105
.setEmoji("📑"),
116106
).addComponents(
117107
new ButtonBuilder()
118-
.setCustomId("editButton")
108+
.setCustomId("editButton_apology")
119109
.setStyle(ButtonStyle.Primary)
120-
.setEmoji("✏️")
121-
.setDisabled(),
110+
.setEmoji("✏️"),
122111
).addComponents(
123112
new ButtonBuilder()
124-
.setCustomId("deleteButton")
113+
.setCustomId("deleteButton_apology")
125114
.setStyle(ButtonStyle.Danger)
126115
.setEmoji("🗑️")
127-
.setDisabled(),
128116
);
129117

130118
const dutyEmbed = new EmbedBuilder()
131119
.setAuthor({ name: member.displayName, iconURL: member.displayAvatarURL() })
132120
.setTitle("Záznam služby")
133121
.addFields([
134122
{
135-
name: `Duty #` + (index + 1), inline: false,
123+
name: `Služba #` + (index + 1), inline: false,
136124
value:
137125
`> **Datum:** \`${duty.date}\`\n`
138126
+ `> **Od:** \`${duty.start}\`\n`
@@ -142,7 +130,7 @@ export default async function folders(bot) {
142130
])
143131
.setThumbnail("https://i.imgur.com/fhif3Xj.png")
144132
.setColor(bot.LEA.c.duty)
145-
.setFooter({ text: `SAHP | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i.SAHP });
133+
.setFooter({ text: `SAHP | LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i.SAHP });
146134

147135
const msg = await folder.send({ embeds: [dutyEmbed], components: [row] });
148136
worker.duties[index].id = msg.id;

src/functions/other.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function generateFooter() {
2-
return `LEA Bot v${process.env.version} | Vytvořil b1ngo 🎈`;
2+
return `LEA-Bot v${process.env.version} by b1ngo ✏️`;
33
}

src/functions/profiles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function getProfile(bot, id) {
2727
)
2828
.setColor(bot.LEA.c[db.guildName])
2929
.setThumbnail(bot.LEA.i[db.guildName])
30-
.setFooter({ text: `${db.guildName} | Vytvořil b1ngo 🎈`, iconURL: bot.LEA.i[db.guildName] });
30+
.setFooter({ text: `${db.guildName} | LEA-Bot v${process.env.version} by b1ngo ✏️`, iconURL: bot.LEA.i[db.guildName] });
3131
return profileEmbed;
3232
}
3333

0 commit comments

Comments
 (0)