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