Feature/vba 77 #178

Merged
Vylpes merged 13 commits from feature/VBA-77 into develop 2022-09-05 18:10:04 +01:00
Showing only changes of commit bc24a4ecfe - Show all commits

View file

@ -12,13 +12,24 @@ export default class Bunny extends Command {
}
public override async execute(context: ICommandContext) {
const result = await randomBunny('rabbits', 'hot');
const subreddits = [
'rabbits',
'bunnieswithhats',
'buncomfortable',
'bunnytongues',
'dutchbunnymafia',
];
const random = Math.floor(Math.random() * subreddits.length);
const selectedSubreddit = subreddits[random];
const result = await randomBunny(selectedSubreddit, 'hot');
if (result.IsSuccess) {
const embed = new PublicEmbed(context, result.Result!.Title, "")
.setImage(result.Result!.Url)
.setURL(`https://reddit.com${result.Result!.Permalink}`)
.setFooter({ text: `r/Rabbits · ${result.Result!.Ups} upvotes` });
.setFooter({ text: `r/${selectedSubreddit} · ${result.Result!.Ups} upvotes` });
await embed.SendToCurrentChannel();
} else {