watermark and build command[thunder merge pls]

This commit is contained in:
night0721 2022-01-22 20:42:27 +08:00
parent 1098b97060
commit 8e1651e4bf
2 changed files with 30 additions and 6 deletions

View file

@ -97,7 +97,10 @@ module.exports = {
{ {
name: "Swordfish", name: "Swordfish",
value: "swordfish", value: "swordfish",
}, }, // {
// name: "Kilo 141",
// value: "kilo",
// },
], ],
}, },
{ {
@ -113,7 +116,10 @@ module.exports = {
{ {
name: "Jokesta", name: "Jokesta",
value: "jokesta", value: "jokesta",
}, }, // {
// name: "Stats On Duty",
// value: "sod",
// },
], ],
}, },
{ {
@ -217,6 +223,10 @@ module.exports = {
name: "CBR4", name: "CBR4",
value: "cbr4", value: "cbr4",
}, },
{
name: "PPSh 41",
value: "ppsh",
},
], ],
}, },
{ {
@ -391,6 +401,10 @@ module.exports = {
name: "Hades", name: "Hades",
value: "hades", value: "hades",
}, },
{
name: "PKM",
value: "pkm",
},
], ],
}, },
{ {
@ -659,6 +673,7 @@ module.exports = {
cr56amax: "CR-56 AMAX", cr56amax: "CR-56 AMAX",
m13: "M13", m13: "M13",
swordfish: "Swordfish", swordfish: "Swordfish",
// kilo: "Kilo 141",
j358: "J358", j358: "J358",
gs50: ".50 GS", gs50: ".50 GS",
@ -670,7 +685,7 @@ module.exports = {
kiloboltaction: "Kilo Bolt-Action", kiloboltaction: "Kilo Bolt-Action",
sks: "SKS", sks: "SKS",
spr208: "SP-R 208", spr208: "SP-R 208",
mk2: "mk2", mk2: "MK2",
s36: "S36", s36: "S36",
ul736: "UL736", ul736: "UL736",
@ -679,6 +694,7 @@ module.exports = {
chopper: "Chopper", chopper: "Chopper",
holger26: "Holger 26", holger26: "Holger 26",
hades: "Hades", hades: "Hades",
pkm: "PKM",
arctic50: "Arctic .50", arctic50: "Arctic .50",
m21ebr: "M21 EBR", m21ebr: "M21 EBR",
@ -715,6 +731,7 @@ module.exports = {
pp19bizon: "PP19 Bizon", pp19bizon: "PP19 Bizon",
mx9: "MX9", mx9: "MX9",
cbr4: "CBR4", cbr4: "CBR4",
ppsh: "PPSh-41",
}; };
const all = { const all = {
assault_rifle: "Assault Rifle", assault_rifle: "Assault Rifle",
@ -727,6 +744,7 @@ module.exports = {
path: "Path.exe", path: "Path.exe",
dhitman: "dHitman", dhitman: "dHitman",
jokesta: "Jokesta", jokesta: "Jokesta",
sod: "Stats On Duty",
// littleb:"Little B", // littleb:"Little B",
aggressive: "Aggressive", aggressive: "Aggressive",

View file

@ -10,7 +10,6 @@ module.exports = {
description: "Link of photo", description: "Link of photo",
required: true, required: true,
}, },
{ {
type: 3, type: 3,
name: "position", name: "position",
@ -27,6 +26,13 @@ module.exports = {
}, },
], ],
}, },
{
type: 3,
type: "opacity",
description:
"Opacity of watermark(50 - 100) Lower or higher will be ignored",
required: true,
},
{ {
type: 3, type: 3,
name: "logo", name: "logo",
@ -81,7 +87,7 @@ module.exports = {
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const data = await axios const data = await axios
.get( .get(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&logo=${args[2]}&password=${args[3]}` `${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`
) )
.then(res => res.data) .then(res => res.data)
.catch(); .catch();
@ -91,7 +97,7 @@ module.exports = {
}); });
} else { } else {
const ima = new MessageAttachment( const ima = new MessageAttachment(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&logo=${args[2]}&password=${args[3]}`, `${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`,
`${args[2]}.png` `${args[2]}.png`
); );
interaction.followUp({ files: [ima] }); interaction.followUp({ files: [ima] });