This commit is contained in:
Flummi 2019-08-19 14:20:59 +00:00
parent d6a737931a
commit cd606aa6eb

View File

@ -17,10 +17,8 @@ export default async bot => {
const nick = e.args[0] || e.user.nick;
let res = await (await fetch(`${api}${nick}`)).json();
if(res.error) return {
err: true,
msg: "User not found"
};
if(res.error)
return e.reply("User not found");
res = res.recenttracks;
const track = res.track[0];
@ -30,14 +28,9 @@ export default async bot => {
playing: track["@attr"] ? true : false
};
return {
err: false,
mode: "normal",
msg: info.playing ?
return e.reply(info.playing ?
`[b]${info.user}[/b] is listening to [b]${info.track}[/b]` :
`[b]${info.user}[/b] is not listening to anything. They last listened to [b]${info.track}[/b]`
};
`[b]${info.user}[/b] is not listening to anything. They last listened to [b]${info.track}[/b]`);
}
}];
};