Skip to content

Commit

Permalink
Merge pull request #66 from reinhello/bookmark
Browse files Browse the repository at this point in the history
Set bookmark max limit to 25
  • Loading branch information
reinacchi authored Aug 14, 2022
2 parents 15ebd19 + 4c07e9d commit 003fde9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
11 changes: 11 additions & 0 deletions framework/lib/Modules/BookmarkPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ export class BookmarkPaginator {

UserModel.findOneAndUpdate({ id: interaction.member.id }, { $pull: { "bookmark": embed.author.name } }).exec();
} else {
if (userData.bookmark.length === 25) {
return interaction.createMessage({
embeds: [
new Utils.RichEmbed()
.setColor(this.client.config.BOT.COLOUR)
.setDescription(this.client.translate("main.bookmark.maxed"))
],
flags: Constants.MessageFlags.EPHEMERAL
});
}

interaction.createMessage({
embeds: [
new Utils.RichEmbed()
Expand Down
11 changes: 11 additions & 0 deletions framework/lib/Modules/ReadPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,17 @@ export class ReadPaginator {

UserModel.findOneAndUpdate({ id: interaction.member.id }, { $pull: { "bookmark": this.embeds[0].author.name } }).exec();
} else {
if (userData.bookmark.length === 25) {
return interaction.createMessage({
embeds: [
new Utils.RichEmbed()
.setColor(this.client.config.BOT.COLOUR)
.setDescription(this.client.translate("main.bookmark.maxed"))
],
flags: Constants.MessageFlags.EPHEMERAL
});
}

interaction.createMessage({
embeds: [
new Utils.RichEmbed()
Expand Down
11 changes: 11 additions & 0 deletions framework/lib/Modules/ReadSearchPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@ export class ReadSearchPaginator {

UserModel.findOneAndUpdate({ id: interaction.member.id }, { $pull: { "bookmark": this.embeds[0].author.name } }).exec();
} else {
if (userData.bookmark.length === 25) {
return interaction.createMessage({
embeds: [
new Utils.RichEmbed()
.setColor(this.client.config.BOT.COLOUR)
.setDescription(this.client.translate("main.bookmark.maxed"))
],
flags: Constants.MessageFlags.EPHEMERAL
});
}

interaction.createMessage({
embeds: [
new Utils.RichEmbed()
Expand Down
11 changes: 11 additions & 0 deletions framework/lib/Modules/SearchPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,17 @@ export class SearchPaginator {

UserModel.findOneAndUpdate({ id: interaction.member.id }, { $pull: { "bookmark": embed.author.name } }).exec();
} else {
if (userData.bookmark.length === 25) {
return interaction.createMessage({
embeds: [
new Utils.RichEmbed()
.setColor(this.client.config.BOT.COLOUR)
.setDescription(this.client.translate("main.bookmark.maxed"))
],
flags: Constants.MessageFlags.EPHEMERAL
});
}

interaction.createMessage({
embeds: [
new Utils.RichEmbed()
Expand Down

0 comments on commit 003fde9

Please sign in to comment.