mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-31 03:33:36 -05:00
Fetch
This commit is contained in:
parent
d595fc4e90
commit
71b2650f8c
2 changed files with 2 additions and 5 deletions
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
import { ApplicationCommandOptionType } from "../../api/Commands";
|
import { ApplicationCommandOptionType } from "../../api/Commands";
|
||||||
import definePlugin from "../../utils/types";
|
import definePlugin from "../../utils/types";
|
||||||
|
@ -15,7 +14,7 @@ function rand(min, max) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchReddit(sub: string) {
|
async function fetchReddit(sub: string) {
|
||||||
const res = (await axios.get(`https://www.reddit.com/r/${sub}/top.json?limit=100&t=all`)).data;
|
const res = await fetch(`https://www.reddit.com/r/${sub}/top.json?limit=100&t=all`);
|
||||||
const resp = await res.json();
|
const resp = await res.json();
|
||||||
try {
|
try {
|
||||||
const { children } = resp.data;
|
const { children } = resp.data;
|
||||||
|
|
|
@ -6,11 +6,9 @@
|
||||||
|
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
|
|
||||||
async function getcuteneko(): Promise<string> {
|
async function getcuteneko(): Promise<string> {
|
||||||
const res = (await axios.get("https://nekos.best/api/v2/neko")).data;
|
const res = await fetch("https://nekos.best/api/v2/neko");
|
||||||
const url = (await res.json()).results[0].url as string;
|
const url = (await res.json()).results[0].url as string;
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue