This commit is contained in:
Joonas 2023-02-09 19:29:07 +02:00
parent a53eb71470
commit d5eb059b7a
1 changed files with 8 additions and 2 deletions

View File

@ -6,8 +6,14 @@ const command = {
run: async (client, msg, splitted) => {
const data = await fetch(
`https://logs.ivr.fi/channel/${
splitted[2] ? splitted[2] : msg.channelName
}/user/${splitted[3] ? splitted[3] : msg.displayName}/random?json=json`
splitted[2]
? encodeURIComponent(splitted[2])
: encodeURIComponent(msg.channelName)
}/user/${
splitted[3]
? encodeURIComponent(splitted[3])
: encodeURIComponent(msg.displayName)
}/random?json=json`
)
.then((res) => res.json())
.then((data) => data.messages[0])