New command: GetLastCommands
This commit is contained in:
parent
372c4c42cf
commit
2a554925c3
2 changed files with 30 additions and 1 deletions
29
Core/Commands/Self/GetLastCommands.cs
Normal file
29
Core/Commands/Self/GetLastCommands.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BSB.Commands.Self
|
||||
{
|
||||
public class GetLastCommands : CoreCommand
|
||||
{
|
||||
public override string[] ArgTypes { get { return new[] { "Mixed" }; } }
|
||||
public override string[] ArgHints { get { return new[] { "Smart reply [Channel|Avatar|http url]", }; } }
|
||||
public override int MinArgs { get { return 1; } }
|
||||
public override string Helpfile
|
||||
{
|
||||
get
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CallFunction(string[] args)
|
||||
{
|
||||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
return bot.GetCommandsInterface.SmartCommandReply(args[0], String.Join(',',bot.GetLastCommands(5)), CommandName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ namespace BSB.bottypes
|
|||
int loop = 0;
|
||||
while((loop < CommandHistory.Count) && (loop < amount))
|
||||
{
|
||||
commands.Add(CommandHistory.Keys.ElementAt(CommandHistory.Count - loop));
|
||||
commands.Add(CommandHistory.Keys.ElementAt(CommandHistory.Count - loop - 1));
|
||||
loop++;
|
||||
}
|
||||
return commands.ToArray();
|
||||
|
|
|
|||
Loading…
Reference in a new issue