moved extensions to a separate module, added lmgtfy
This commit is contained in:
@@ -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);
|
||||
|
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user