mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
Новая функция - дроп в giveaway
This commit is contained in:
parent
21b1bb5fe8
commit
af14742510
4 changed files with 23 additions and 11 deletions
|
@ -98,11 +98,10 @@ class JaBa extends Client {
|
|||
|
||||
this.giveawaysManager = new GiveawaysManager(this, {
|
||||
storage: "./giveaways.json",
|
||||
updateCountdownEvery: 10000,
|
||||
default: {
|
||||
botsCanWin: false,
|
||||
embedColor: this.config.embed.color,
|
||||
embedColorEnd: "FF00000",
|
||||
embedColorEnd: "#FF0000",
|
||||
reaction: "🎉"
|
||||
}
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ class Giveaway extends Command {
|
|||
dirname: __dirname,
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: ["gway"],
|
||||
aliases: ["gaway"],
|
||||
memberPermissions: ["MENTION_EVERYONE"],
|
||||
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||||
nsfw: false,
|
||||
|
@ -34,23 +34,33 @@ class Giveaway extends Command {
|
|||
if (!winnersCount) return message.error("moderation/giveaway:INVALID_CREATE", { prefix: data.guild.prefix });
|
||||
if (isNaN(winnersCount) || winnersCount > 10 || winnersCount < 1) return message.error("misc:INVALID_NUMBER_RANGE", { min: 1, max: 10 });
|
||||
|
||||
const prize = args.slice(3).join(" ");
|
||||
var drop = (args[3] === "true"),
|
||||
prize = args.slice(3).join(" ");
|
||||
|
||||
if (drop) prize = args.slice(4).join(" ");
|
||||
else prize = args.slice(3).join(" ");
|
||||
|
||||
if (!prize) return message.error("moderation/giveaway:INVALID_CREATE", { prefix: data.guild.prefix });
|
||||
|
||||
this.client.giveawaysManager.start(message.channel, {
|
||||
time: ms(time),
|
||||
prize: prize,
|
||||
duration: ms(time),
|
||||
winnerCount: parseInt(winnersCount, 10),
|
||||
prize: prize,
|
||||
hostedBy: message.author,
|
||||
isDrop: drop,
|
||||
messages: {
|
||||
giveaway: message.translate("moderation/giveaway:TITLE"),
|
||||
giveawayEnded: message.translate("moderation/giveaway:ENDED"),
|
||||
timeRemaining: message.translate("moderation/giveaway:TIME_REMAINING"),
|
||||
inviteToParticipate: message.translate("moderation/giveaway:INVITE_PARTICIPATE"),
|
||||
winMessage: message.translate("moderation/giveaway:WIN_MESSAGE"),
|
||||
drawing: message.translate("moderation/giveaway:DRAWING"),
|
||||
dropMessage: message.translate("moderation/giveaway:DROP"),
|
||||
embedFooter: message.translate("moderation/giveaway:FOOTER"),
|
||||
noWinner: message.translate("moderation/giveaway:NO_WINNER"),
|
||||
winners: message.translate("moderation/giveaway:WINNERS"),
|
||||
endedAt: message.translate("moderation/giveaway:END_AT"),
|
||||
hostedBy: message.translate("moderation/giveaway:HOSTEDBY"),
|
||||
units: {
|
||||
seconds: message.translate("time:SECONDS", {
|
||||
amount: ""
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"DESCRIPTION": "Управление раздачами!",
|
||||
"USAGE": "{{prefix}}giveaway [create/reroll/delete/end] (время) (кол-во победителей) (приз)",
|
||||
"EXAMPLES": "{{prefix}}giveaway create 10m 2 100 рублей на карту!\n{{prefix}}giveaway reroll 597812898022031374",
|
||||
"USAGE": "{{prefix}}giveaway [create/reroll/delete/end] [время] [кол-во победителей] (Дроп? true) [приз]",
|
||||
"EXAMPLES": "{{prefix}}giveaway create 1d 2 100 рублей на карту!\n{{prefix}}giveaway create 1d 2 true 100 рублей на карту\n{{prefix}}giveaway reroll 597812898022031374",
|
||||
"MISSING_STATUS": "Выберите действие: `create`, `reroll`, `end` или `delete`!",
|
||||
"INVALID_CREATE": "Какой-то из аргументов указан неверно, попробуйте снова!",
|
||||
"MISSING_ID": "Укажите ID сообщения раздачи!",
|
||||
|
@ -13,11 +13,14 @@
|
|||
"ENDED": "🎉🎉 **РАЗДАЧА ОКОНЧЕНА** 🎉🎉",
|
||||
"TIME_REMAINING": "Оставшееся время: **{duration}**!",
|
||||
"INVITE_PARTICIPATE": "Отреагируйте 🎉, чтобы участвовать!",
|
||||
"WIN_MESSAGE": "Поздравляем, {winners}! Вы выиграли **{prize}**!",
|
||||
"WIN_MESSAGE": "Поздравляем, {winners}! Вы выиграли **{this.prize}**!",
|
||||
"DRAWING": "Заканчивается: {timestamp}",
|
||||
"DROP": "Будь первым кто отреагирует 🎉!",
|
||||
"FOOTER": "Раздача",
|
||||
"NO_WINNER": "Раздача отменена, никто не участвовал.",
|
||||
"WINNERS": "Победитель(и)",
|
||||
"END_AT": "Заканчивается",
|
||||
"END_AT": "Закончилась:",
|
||||
"HOSTEDBY": "Организатор: {this.hostedBy}",
|
||||
"REROLL_CONGRAT": "🎉 Новый(е) побелитель(и): {winners}! Поздравляем!",
|
||||
"REROLL_ERROR": "Нет действительных заявок, никто не выиграл!",
|
||||
"GIVEAWAY_CREATED": "Раздача начата!",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"dblapi.js": "^2.3.0",
|
||||
"discord-backup": "^3.0.1",
|
||||
"discord-canvas": "^1.3.2",
|
||||
"discord-giveaways": "^5.0.1",
|
||||
"discord-giveaways": "github:Androz2091/discord-giveaways#develop",
|
||||
"discord-paginationembed": "github:gazmull/discord-paginationembed#v3",
|
||||
"discord-together": "^1.3.25",
|
||||
"discord.js": "^13.5.0",
|
||||
|
|
Loading…
Reference in a new issue