mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
Fixed some aliases and reworked namespaces
This commit is contained in:
@@ -35,7 +35,7 @@ public partial class Searches
|
||||
// .AddField(GetText(strs.genres), string.Join(" ", novelData.Genres.Any() ? novelData.Genres : new[] { "none" }), true)
|
||||
// .WithFooter($"{GetText(strs.score)} {novelData.Score}");
|
||||
//
|
||||
// await ctx.Channel.EmbedAsync(embed);
|
||||
// await EmbedAsync(embed);
|
||||
// }
|
||||
|
||||
[Cmd]
|
||||
@@ -110,7 +110,7 @@ public partial class Searches
|
||||
.WithUrl(fullQueryLink)
|
||||
.WithImageUrl(imageUrl);
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
private static string MalInfoToEmoji(string info)
|
||||
@@ -165,7 +165,7 @@ public partial class Searches
|
||||
string.Join(",\n", animeData.Genres.Any() ? animeData.Genres : new[] { "none" }),
|
||||
true)
|
||||
.WithFooter($"{GetText(strs.score)} {animeData.AverageScore} / 100");
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -198,7 +198,7 @@ public partial class Searches
|
||||
true)
|
||||
.WithFooter($"{GetText(strs.score)} {mangaData.AverageScore} / 100");
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
}
|
||||
}
|
@@ -92,7 +92,7 @@ public partial class Searches
|
||||
// .AddField("Change 200d", $"{sign200}{change200}", true)
|
||||
.WithFooter(stock.Exchange);
|
||||
|
||||
var message = await ctx.Channel.EmbedAsync(eb);
|
||||
var message = await EmbedAsync(eb);
|
||||
await using var imageData = await stockImageTask;
|
||||
if (imageData is null)
|
||||
return;
|
||||
|
@@ -117,7 +117,7 @@ public partial class Searches
|
||||
|
||||
if (!feeds.Any())
|
||||
{
|
||||
await ctx.Channel.EmbedAsync(_eb.Create().WithOkColor().WithDescription(GetText(strs.feed_no_feed)));
|
||||
await EmbedAsync(_eb.Create().WithOkColor().WithDescription(GetText(strs.feed_no_feed)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ using LinqToDB;
|
||||
using LinqToDB.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NadekoBot.Db;
|
||||
using Nadeko.Bot.Db.Models;
|
||||
using NadekoBot.Db.Models;
|
||||
|
||||
namespace NadekoBot.Modules.Searches.Services;
|
||||
|
||||
|
@@ -49,7 +49,7 @@ public partial class Searches
|
||||
var obj = objs[0];
|
||||
var userId = obj.UserId;
|
||||
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
await EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle($"osu! {smode} profile for {user}")
|
||||
.WithThumbnailUrl($"https://a.ppy.sh/{userId}")
|
||||
@@ -109,7 +109,7 @@ public partial class Searches
|
||||
.AddField("Playcount", userStats.Playcount, true)
|
||||
.AddField("Level", userStats.Level, true);
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -172,7 +172,7 @@ public partial class Searches
|
||||
foreach (var (title, desc) in mapData.Where(x => x != default))
|
||||
eb.AddField(title, desc);
|
||||
|
||||
await ctx.Channel.EmbedAsync(eb);
|
||||
await EmbedAsync(eb);
|
||||
}
|
||||
|
||||
//https://osu.ppy.sh/wiki/Accuracy
|
||||
|
@@ -137,7 +137,7 @@ public partial class Searches
|
||||
{
|
||||
var embed = _eb.Create().WithDescription(GetText(strs.account_not_found)).WithErrorColor();
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public partial class Searches
|
||||
{
|
||||
var eembed = _eb.Create().WithDescription(GetText(strs.leagues_not_found)).WithErrorColor();
|
||||
|
||||
await ctx.Channel.EmbedAsync(eembed);
|
||||
await EmbedAsync(eembed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public partial class Searches
|
||||
|
||||
embed.WithDescription(sb.ToString());
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -281,13 +281,13 @@ public partial class Searches
|
||||
.AddField($"{cleanConvert} Equivalent", chaosEquivalent / conversionEquivalent, true)
|
||||
.WithOkColor();
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
catch
|
||||
{
|
||||
var embed = _eb.Create().WithDescription(GetText(strs.ninja_not_found)).WithErrorColor();
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,71 +0,0 @@
|
||||
#nullable disable
|
||||
namespace NadekoBot.Modules.Searches;
|
||||
|
||||
public partial class Searches
|
||||
{
|
||||
[Group]
|
||||
public partial class PlaceCommands : NadekoModule
|
||||
{
|
||||
public enum PlaceType
|
||||
{
|
||||
Cage, //http://www.placecage.com
|
||||
Steven, //http://www.stevensegallery.com
|
||||
Beard, //http://placebeard.it
|
||||
Fill, //http://www.fillmurray.com
|
||||
Bear, //https://www.placebear.com
|
||||
Kitten, //http://placekitten.com
|
||||
Bacon, //http://baconmockup.com
|
||||
Xoart //http://xoart.link
|
||||
}
|
||||
|
||||
private static readonly string _typesStr = string.Join(", ", Enum.GetNames<PlaceType>());
|
||||
|
||||
[Cmd]
|
||||
public async Task Placelist()
|
||||
=> await SendConfirmAsync(GetText(strs.list_of_place_tags(prefix)), _typesStr);
|
||||
|
||||
[Cmd]
|
||||
public async Task Place(PlaceType placeType, uint width = 0, uint height = 0)
|
||||
{
|
||||
var url = string.Empty;
|
||||
switch (placeType)
|
||||
{
|
||||
case PlaceType.Cage:
|
||||
url = "http://www.placecage.com";
|
||||
break;
|
||||
case PlaceType.Steven:
|
||||
url = "http://www.stevensegallery.com";
|
||||
break;
|
||||
case PlaceType.Beard:
|
||||
url = "http://placebeard.it";
|
||||
break;
|
||||
case PlaceType.Fill:
|
||||
url = "http://www.fillmurray.com";
|
||||
break;
|
||||
case PlaceType.Bear:
|
||||
url = "https://www.placebear.com";
|
||||
break;
|
||||
case PlaceType.Kitten:
|
||||
url = "http://placekitten.com";
|
||||
break;
|
||||
case PlaceType.Bacon:
|
||||
url = "http://baconmockup.com";
|
||||
break;
|
||||
case PlaceType.Xoart:
|
||||
url = "http://xoart.link";
|
||||
break;
|
||||
}
|
||||
|
||||
var rng = new NadekoRandom();
|
||||
if (width is <= 0 or > 1000)
|
||||
width = (uint)rng.Next(250, 850);
|
||||
|
||||
if (height is <= 0 or > 1000)
|
||||
height = (uint)rng.Next(250, 850);
|
||||
|
||||
url += $"/{width}/{height}";
|
||||
|
||||
await ctx.Channel.SendMessageAsync(url);
|
||||
}
|
||||
}
|
||||
}
|
@@ -25,7 +25,7 @@ public partial class Searches
|
||||
if (kvp.Key.ToUpperInvariant() == pokemon.ToUpperInvariant())
|
||||
{
|
||||
var p = kvp.Value;
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
await EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle(kvp.Key.ToTitleCase())
|
||||
.WithDescription(p.BaseStats.ToString())
|
||||
@@ -55,7 +55,7 @@ public partial class Searches
|
||||
{
|
||||
if (kvp.Key.ToUpperInvariant() == ability)
|
||||
{
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
await EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle(kvp.Value.Name)
|
||||
.WithDescription(string.IsNullOrWhiteSpace(kvp.Value.Desc)
|
||||
|
@@ -68,7 +68,7 @@ public partial class Searches
|
||||
GetText(strs.results_in(data.Info.TotalResults, data.Info.SearchTime)),
|
||||
"https://i.imgur.com/G46fm8J.png");
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -121,7 +121,7 @@ public partial class Searches
|
||||
embeds.Add(CreateEmbed(entry));
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(null, embeds: embeds);
|
||||
await EmbedAsync(null, embeds: embeds);
|
||||
}
|
||||
|
||||
private TypedKey<string> GetYtCacheKey(string query)
|
||||
@@ -196,7 +196,7 @@ public partial class Searches
|
||||
// .WithDescription($"{GetText(strs.search_for)} **{query}**\n\n" + descStr)
|
||||
// .WithOkColor();
|
||||
//
|
||||
// await ctx.Channel.EmbedAsync(embed);
|
||||
// await EmbedAsync(embed);
|
||||
// }
|
||||
}
|
||||
}
|
@@ -93,7 +93,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
$"https://openweathermap.org/img/w/{data.Weather[0].Icon}.png");
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -159,7 +159,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
await EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle(movie.Title)
|
||||
.WithUrl($"https://www.imdb.com/title/{movie.ImdbId}/")
|
||||
@@ -189,7 +189,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
private Task InternalRandomImage(SearchesService.ImageTag tag)
|
||||
{
|
||||
var url = _service.GetRandomImageUrl(tag);
|
||||
return ctx.Channel.EmbedAsync(_eb.Create().WithOkColor().WithImageUrl(url));
|
||||
return EmbedAsync(_eb.Create().WithOkColor().WithImageUrl(url));
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -239,7 +239,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
}
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
await EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.AddField(GetText(strs.original_url), $"<{query}>")
|
||||
.AddField(GetText(strs.short_url), $"<{shortLink}>"));
|
||||
@@ -269,7 +269,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
.AddField(GetText(strs.cost), card.ManaCost, true)
|
||||
.AddField(GetText(strs.types), card.Types, true);
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -298,7 +298,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
if (!string.IsNullOrWhiteSpace(card.Flavor))
|
||||
embed.WithDescription(card.Flavor);
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -468,7 +468,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
|
||||
var avatarUrl = usr.RealAvatarUrl(2048);
|
||||
|
||||
await ctx.Channel.EmbedAsync(
|
||||
await EmbedAsync(
|
||||
_eb.Create()
|
||||
.WithOkColor()
|
||||
.AddField("Username", usr.ToString())
|
||||
@@ -536,7 +536,7 @@ public partial class Searches : NadekoModule<SearchesService>
|
||||
else
|
||||
{
|
||||
var v = obj.Verses[0];
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
await EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle($"{v.BookName} {v.Chapter}:{v.Verse}")
|
||||
.WithDescription(v.Text));
|
||||
|
@@ -8,9 +8,6 @@ using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Drawing.Processing;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
using System.Collections;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Color = SixLabors.ImageSharp.Color;
|
||||
using Image = SixLabors.ImageSharp.Image;
|
||||
|
||||
|
@@ -29,7 +29,7 @@ public partial class Searches
|
||||
}
|
||||
|
||||
var embed = _service.GetEmbed(ctx.Guild.Id, data);
|
||||
await ctx.Channel.EmbedAsync(embed, GetText(strs.stream_tracked));
|
||||
await EmbedAsync(embed, GetText(strs.stream_tracked));
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
|
@@ -1,12 +1,10 @@
|
||||
#nullable disable
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Common.ModuleBehaviors;
|
||||
using NadekoBot.Db;
|
||||
using NadekoBot.Db.Models;
|
||||
using NadekoBot.Modules.Searches.Common;
|
||||
using NadekoBot.Modules.Searches.Common.StreamNotifications;
|
||||
using Nadeko.Bot.Db.Models;
|
||||
|
||||
namespace NadekoBot.Modules.Searches.Services;
|
||||
|
||||
|
@@ -3,7 +3,7 @@ using LinqToDB;
|
||||
using LinqToDB.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NadekoBot.Common.ModuleBehaviors;
|
||||
using Nadeko.Bot.Db.Models;
|
||||
using NadekoBot.Db.Models;
|
||||
using System.Net;
|
||||
|
||||
namespace NadekoBot.Modules.Searches;
|
||||
|
@@ -22,7 +22,7 @@ public partial class Searches
|
||||
|
||||
var embed = _eb.Create(ctx).WithOkColor().AddField(from, text).AddField(to, translation);
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed);
|
||||
await EmbedAsync(embed);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -89,7 +89,7 @@ public partial class Searches
|
||||
eb.AddField("", chunk.Join("\n"), isInline: true);
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(eb);
|
||||
await EmbedAsync(eb);
|
||||
}
|
||||
}
|
||||
}
|
@@ -31,7 +31,7 @@ public partial class Searches
|
||||
.WithAuthor(comic.Title, "https://xkcd.com/s/919f27.ico", $"{XKCD_URL}/{comic.Num}")
|
||||
.AddField(GetText(strs.comic_number), comic.Num.ToString(), true)
|
||||
.AddField(GetText(strs.date), $"{comic.Month}/{comic.Year}", true);
|
||||
var sent = await ctx.Channel.EmbedAsync(embed);
|
||||
var sent = await EmbedAsync(embed);
|
||||
|
||||
await Task.Delay(10000);
|
||||
|
||||
@@ -67,7 +67,7 @@ public partial class Searches
|
||||
.AddField(GetText(strs.comic_number), comic.Num.ToString(), true)
|
||||
.AddField(GetText(strs.date), $"{comic.Month}/{comic.Year}", true);
|
||||
|
||||
var sent = await ctx.Channel.EmbedAsync(embed);
|
||||
var sent = await EmbedAsync(embed);
|
||||
|
||||
await Task.Delay(10000);
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#nullable disable
|
||||
using LinqToDB.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Nadeko.Bot.Db.Models;
|
||||
using NadekoBot.Db.Models;
|
||||
|
||||
namespace NadekoBot.Modules.Searches;
|
||||
|
||||
|
Reference in New Issue
Block a user