Some refactorings - Updated editorconfig, removed some unused variables and parameters, updated some old thorwaway variable code, some general cleanup

This commit is contained in:
Kwoth
2022-02-01 13:51:07 +01:00
parent d31cfcc5a8
commit 7ee51332b0
20 changed files with 64 additions and 201 deletions

View File

@@ -38,7 +38,7 @@ public partial class Searches
var rawJson = await res.Content.ReadAsStringAsync();
var data = JsonConvert.DeserializeObject<List<MemegenTemplate>>(rawJson);
var data = JsonConvert.DeserializeObject<List<MemegenTemplate>>(rawJson)!;
await ctx.SendPaginatedConfirmAsync(page,
curPage =>

View File

@@ -520,16 +520,16 @@ public partial class Searches : NadekoModule<SearchesService>
await ctx.SendPaginatedConfirmAsync(0,
page =>
{
var data = col.Skip(page).First();
var model = col.Skip(page).First();
var embed = _eb.Create()
.WithDescription(ctx.User.Mention)
.AddField(GetText(strs.word), data.Word, true)
.AddField(GetText(strs._class), data.WordType, true)
.AddField(GetText(strs.definition), data.Definition)
.AddField(GetText(strs.word), model.Word, true)
.AddField(GetText(strs._class), model.WordType, true)
.AddField(GetText(strs.definition), model.Definition)
.WithOkColor();
if (!string.IsNullOrWhiteSpace(data.Example))
embed.AddField(GetText(strs.example), data.Example);
if (!string.IsNullOrWhiteSpace(model.Example))
embed.AddField(GetText(strs.example), model.Example);
return embed;
},

View File

@@ -229,6 +229,7 @@ public class SearchesService : INService
+ $"&by=position"
+ $"&lat={geoData.Lat}"
+ $"&lng={geoData.Lon}");
using var geoRes = await http.SendAsync(req);
var resString = await geoRes.Content.ReadAsStringAsync();
var timeObj = JsonConvert.DeserializeObject<TimeZoneResult>(resString);