Adding random images of squirrels, croissants, pumpkins and turtles, combined all in mediaprovider class
This commit is contained in:
parent
0c9a2a5619
commit
f30c136785
11 changed files with 281 additions and 113 deletions
|
@ -11,15 +11,15 @@ namespace Geekbot.net.Commands
|
|||
{
|
||||
public class CheckEm : ModuleBase
|
||||
{
|
||||
private readonly ICheckEmImageProvider checkEmImages;
|
||||
private readonly IMediaProvider checkEmImages;
|
||||
private readonly Random rnd;
|
||||
private readonly ILogger logger;
|
||||
private readonly IErrorHandler errorHandler;
|
||||
|
||||
public CheckEm(Random RandomClient, ICheckEmImageProvider checkEmImages, ILogger logger, IErrorHandler errorHandler)
|
||||
public CheckEm(Random RandomClient, IMediaProvider mediaProvider, ILogger logger, IErrorHandler errorHandler)
|
||||
{
|
||||
this.rnd = RandomClient;
|
||||
this.checkEmImages = checkEmImages;
|
||||
this.checkEmImages = mediaProvider;
|
||||
this.logger = logger;
|
||||
this.errorHandler = errorHandler;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace Geekbot.net.Commands
|
|||
sb.AppendLine($"**{number}**");
|
||||
if (!string.IsNullOrEmpty(dubtriqua))
|
||||
sb.AppendLine($":tada: {dubtriqua} :tada:");
|
||||
sb.AppendLine(checkEmImages.GetRandomCheckEmPic());
|
||||
sb.AppendLine(checkEmImages.getCheckem());
|
||||
|
||||
await ReplyAsync(sb.ToString());
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
using Discord.Commands;
|
||||
using Geekbot.net.Lib.Media;
|
||||
|
||||
namespace Geekbot.net.Commands
|
||||
{
|
||||
public class Panda : ModuleBase
|
||||
{
|
||||
private readonly IPandaProvider pandaImages;
|
||||
|
||||
public Panda(IPandaProvider pandaImages)
|
||||
{
|
||||
this.pandaImages = pandaImages;
|
||||
}
|
||||
|
||||
[Command("panda", RunMode = RunMode.Async)]
|
||||
[Summary("Get a random panda")]
|
||||
public async Task PandaCommand()
|
||||
{
|
||||
await ReplyAsync(pandaImages.GetRandomPanda());
|
||||
}
|
||||
}
|
||||
}
|
52
Geekbot.net/Commands/RandomAnimals.cs
Normal file
52
Geekbot.net/Commands/RandomAnimals.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
using System.Threading.Tasks;
|
||||
using Discord.Commands;
|
||||
using Geekbot.net.Lib.Media;
|
||||
|
||||
namespace Geekbot.net.Commands
|
||||
{
|
||||
public class RandomAnimals : ModuleBase
|
||||
{
|
||||
private readonly IMediaProvider _mediaProvider;
|
||||
|
||||
public RandomAnimals(IMediaProvider mediaProvider)
|
||||
{
|
||||
_mediaProvider = mediaProvider;
|
||||
}
|
||||
|
||||
[Command("panda", RunMode = RunMode.Async)]
|
||||
[Summary("Get a random panda image")]
|
||||
public async Task panda()
|
||||
{
|
||||
await ReplyAsync(_mediaProvider.getPanda());
|
||||
}
|
||||
|
||||
[Command("croissant", RunMode = RunMode.Async)]
|
||||
[Alias("gipfeli")]
|
||||
[Summary("Get a random croissant image")]
|
||||
public async Task croissant()
|
||||
{
|
||||
await ReplyAsync(_mediaProvider.getCrossant());
|
||||
}
|
||||
|
||||
[Command("pumpkin", RunMode = RunMode.Async)]
|
||||
[Summary("Get a random pumpkin image")]
|
||||
public async Task pumpkin()
|
||||
{
|
||||
await ReplyAsync(_mediaProvider.getPumpkin());
|
||||
}
|
||||
|
||||
[Command("squirrel", RunMode = RunMode.Async)]
|
||||
[Summary("Get a random squirrel image")]
|
||||
public async Task squirrel()
|
||||
{
|
||||
await ReplyAsync(_mediaProvider.getSquirrel());
|
||||
}
|
||||
|
||||
[Command("turtle", RunMode = RunMode.Async)]
|
||||
[Summary("Get a random turtle image")]
|
||||
public async Task turtle()
|
||||
{
|
||||
await ReplyAsync(_mediaProvider.getTurtle());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue