some fixing refactoring
This commit is contained in:
parent
b81681f59c
commit
baeb02adf5
|
@ -55,10 +55,12 @@ const command = {
|
|||
}
|
||||
|
||||
default: {
|
||||
client.say(
|
||||
msg.channelName,
|
||||
`${msg.displayName}, supply an action (create or fetch)`
|
||||
);
|
||||
client
|
||||
.say(
|
||||
msg.channelName,
|
||||
`${msg.displayName}, supply an action (create or fetch)`
|
||||
)
|
||||
.catch((err) => console.log(err));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,12 @@ const command = {
|
|||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("url", splitted[2]);
|
||||
formData.append(
|
||||
"url",
|
||||
splitted[2].startsWith("https://") || splitted[2].startsWith("http://")
|
||||
? splitted[2]
|
||||
: `https://${splitted[2]}`
|
||||
);
|
||||
|
||||
const data = await fetch(`https://s.lain.la`, {
|
||||
method: "post",
|
||||
|
|
|
@ -11,7 +11,12 @@ const command = {
|
|||
}
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("long_url", splitted[2]);
|
||||
formData.append(
|
||||
"long_url",
|
||||
splitted[2].startsWith("https://") || splitted[2].startsWith("http://")
|
||||
? splitted[2]
|
||||
: `https://${splitted[2]}`
|
||||
);
|
||||
|
||||
const data = await fetch(
|
||||
`https://verylegit.link/sketchify?long_url=twitter.com`,
|
||||
|
|
|
@ -26,7 +26,7 @@ const command = {
|
|||
msg.channelName,
|
||||
`${msg.displayName}, Latest tweet for ${
|
||||
splitted[2] ? splitted[2] : "forsen"
|
||||
}: "${data.title}" Media: ${data.description
|
||||
}: "${data.title.replaceAll("\n", "")}" Media: ${data.description
|
||||
.split('"')
|
||||
.filter((item) => item.startsWith("https://"))
|
||||
.join(" ")} Link: ${data.link}`
|
||||
|
|
Loading…
Reference in New Issue