moved extensions to a separate module, added lmgtfy

This commit is contained in:
Master Kwoth
2016-01-21 03:17:01 +01:00
parent eac933e4ec
commit 40227a175a
14 changed files with 33 additions and 21 deletions

View File

@@ -6,8 +6,9 @@ using System.Security.Cryptography;
using Discord.Commands;
using Discord;
using Discord.Legacy;
using NadekoBot.Modules;
namespace NadekoBot
namespace NadekoBot.Extensions
{
public static class Extensions
{
@@ -113,6 +114,16 @@ namespace NadekoBot
}
}
/// <summary>
/// Shortens a string URL
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <param name="action"></param>
public static string ShortenUrl(this string str) {
return Searches.ShortenUrl(str);
}
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) {
foreach (T element in source) {
action(element);

View File

@@ -8,7 +8,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Timers;
using Discord.Legacy;
using NadekoBot.Extensions;
namespace NadekoBot
{