Fixes, quests are slightly more difficult

This commit is contained in:
Toastie 2025-03-30 17:37:34 +13:00
parent aba5c4fbfd
commit 6891869046
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
15 changed files with 31 additions and 30 deletions

View file

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Discord.Net.Core" Version="3.17.1" /> <PackageReference Include="Discord.Net.Core" Version="3.17.2" />
<PackageReference Include="Serilog" Version="4.2.0" /> <PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="YamlDotNet" Version="15.1.6" /> <PackageReference Include="YamlDotNet" Version="15.1.6" />
</ItemGroup> </ItemGroup>

View file

@ -25,7 +25,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="CodeHollow.FeedReader" Version="1.2.6" /> <PackageReference Include="CodeHollow.FeedReader" Version="1.2.6" />
<PackageReference Include="CommandLineParser" Version="2.9.1" /> <PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Discord.Net" Version="3.17.1" /> <PackageReference Include="Discord.Net" Version="3.17.2" />
<PackageReference Include="CoreCLR-NCalc" Version="3.1.253" /> <PackageReference Include="CoreCLR-NCalc" Version="3.1.253" />
<PackageReference Include="Google.Apis.Urlshortener.v1" Version="1.41.1.138" /> <PackageReference Include="Google.Apis.Urlshortener.v1" Version="1.41.1.138" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.68.0.3653" /> <PackageReference Include="Google.Apis.YouTube.v3" Version="1.68.0.3653" />

View file

@ -248,27 +248,27 @@ public class GamblingService : IEService, IReadyExecutor
if (boostGuilds.Count > 0) if (boostGuilds.Count > 0)
{ {
if (booster) if (booster)
msg += $"\\✅ *+{N(gcsData.BoostBonus.BaseTimelyBonus)} bonus for boosting {userInfo.guild}!*\n"; msg += $"✅ *+{N(gcsData.BoostBonus.BaseTimelyBonus)} bonus for boosting {userInfo.guild}!*\n";
else else
msg += $"\\❌ *+0 bonus for boosting {userInfo.guild}*\n"; msg += $"❌ *+0 bonus for boosting {userInfo.guild}*\n";
} }
if (_ps.GetConfig().IsEnabled) if (_ps.GetConfig().IsEnabled)
{ {
if (percentBonus > float.Epsilon) if (percentBonus > float.Epsilon)
msg += msg +=
$"\\✅ *+{percentBonus:P0} bonus for the [Patreon](https://patreon.com/elliebot) pledge! <:hart:746995901758832712>*\n"; $"✅ *+{percentBonus:P0} bonus for the [Patreon](https://patreon.com/elliebot) pledge! <:hart:746995901758832712>*\n";
else else
msg += $"\\❌ *+0 bonus for the [Patreon](https://patreon.com/elliebot) pledge*\n"; msg += $"❌ *+0 bonus for the [Patreon](https://patreon.com/elliebot) pledge*\n";
} }
if (hasCompletedDailies) if (hasCompletedDailies)
{ {
msg += $"\\✅ *+50% bonus for completing daily quests*\n"; msg += $"✅ *+50% bonus for completing daily quests*\n";
} }
else else
{ {
msg += $"\\❌ *+0 bonus for completing daily quests*\n"; msg += $"❌ *+0 bonus for completing daily quests*\n";
} }
return (originalAmount, msg); return (originalAmount, msg);

View file

@ -14,7 +14,6 @@ public sealed class ServerCountRewardService(
) )
: IEService, IReadyExecutor : IEService, IReadyExecutor
{ {
private Task dblTask = Task.CompletedTask; private Task dblTask = Task.CompletedTask;
private Task discordsTask = Task.CompletedTask; private Task discordsTask = Task.CompletedTask;
@ -37,7 +36,7 @@ public sealed class ServerCountRewardService(
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", dblApiKey); httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", dblApiKey);
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
await httpClient.PostAsJsonAsync( await httpClient.PostAsJsonAsync(
$"https://discordbotlist.com/api/v1/bots/{116275390695079945}/stats", $"https://discordbotlist.com/api/v1/bots/{608119997713350679}/stats",
new new
{ {
users = client.Guilds.Sum(x => x.MemberCount), users = client.Guilds.Sum(x => x.MemberCount),
@ -159,7 +158,7 @@ public class VoteRewardService(
await sender await sender
.Response(user) .Response(user)
.Confirm(strs.vote_reward(N(reward)) + "\n\n" + msg) .Confirm($"You've received{N(reward)} for voting!\n\n{msg}")
.SendAsync(); .SendAsync();
} }
catch (Exception ex) catch (Exception ex)
@ -176,7 +175,7 @@ public class VoteRewardService(
{ {
var user = await client.GetUserAsync(userId); var user = await client.GetUserAsync(userId);
await _voteFeedChannel.SendMessageAsync( await _voteFeedChannel.SendMessageAsync(
$"{user} just received {strs.vote_reward(N(reward))} for voting!", $"**{user}** just received **{N(reward)}** for voting!",
allowedMentions: AllowedMentions.None); allowedMentions: AllowedMentions.None);
} }
catch (Exception ex) catch (Exception ex)

View file

@ -9,7 +9,7 @@ public sealed class BetQuest : IQuest
=> "High Roller"; => "High Roller";
public string Desc public string Desc
=> "Place 10 bets"; => "Place 20 bets";
public string ProgDesc public string ProgDesc
=> "bets placed"; => "bets placed";
@ -18,7 +18,7 @@ public sealed class BetQuest : IQuest
=> QuestEventType.BetPlaced; => QuestEventType.BetPlaced;
public long RequiredAmount public long RequiredAmount
=> 10; => 20;
public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress) public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress)
{ {

View file

@ -9,7 +9,7 @@ public sealed class CatchFishQuest : IQuest
=> "Fisherman"; => "Fisherman";
public string Desc public string Desc
=> "Catch 5 fish"; => "Catch 10 fish";
public string ProgDesc public string ProgDesc
=> "fish caught"; => "fish caught";
@ -18,7 +18,7 @@ public sealed class CatchFishQuest : IQuest
=> QuestEventType.FishCaught; => QuestEventType.FishCaught;
public long RequiredAmount public long RequiredAmount
=> 5; => 10;
public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress) public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress)
{ {

View file

@ -9,7 +9,7 @@ public sealed class CatchTrashQuest : IQuest
=> "Environmentalist"; => "Environmentalist";
public string Desc public string Desc
=> "Catch 5 trash items while fishing"; => "Catch 10 trash items while fishing";
public string ProgDesc public string ProgDesc
=> "items caught"; => "items caught";
@ -18,7 +18,7 @@ public sealed class CatchTrashQuest : IQuest
=> QuestEventType.FishCaught; => QuestEventType.FishCaught;
public long RequiredAmount public long RequiredAmount
=> 5; => 10;
public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress) public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress)
{ {

View file

@ -9,7 +9,7 @@ public sealed class GiftWaifuQuest : IQuest
=> "Generous Gifter"; => "Generous Gifter";
public string Desc public string Desc
=> "Gift a waifu"; => "Gift a waifu 2 times";
public string ProgDesc public string ProgDesc
=> "waifus gifted"; => "waifus gifted";
@ -18,7 +18,7 @@ public sealed class GiftWaifuQuest : IQuest
=> QuestEventType.WaifuGiftSent; => QuestEventType.WaifuGiftSent;
public long RequiredAmount public long RequiredAmount
=> 1; => 2;
public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress) public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress)
{ {

View file

@ -9,7 +9,7 @@ public sealed class GiveFlowersQuest : IQuest
=> "Sharing is Caring"; => "Sharing is Caring";
public string Desc public string Desc
=> "Give 10 flowers to someone"; => "Give 20 flowers to someone";
public string ProgDesc public string ProgDesc
=> "flowers given"; => "flowers given";
@ -18,7 +18,7 @@ public sealed class GiveFlowersQuest : IQuest
=> QuestEventType.Give; => QuestEventType.Give;
public long RequiredAmount public long RequiredAmount
=> 10; => 20;
public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress) public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress)
{ {

View file

@ -9,7 +9,7 @@ public sealed class HangmanWinQuest : IQuest
=> "Hangman Champion"; => "Hangman Champion";
public string Desc public string Desc
=> "Win a game of Hangman"; => "Win 2 games of Hangman";
public string ProgDesc public string ProgDesc
=> "hangman games won"; => "hangman games won";
@ -18,7 +18,7 @@ public sealed class HangmanWinQuest : IQuest
=> QuestEventType.GameWon; => QuestEventType.GameWon;
public long RequiredAmount public long RequiredAmount
=> 1; => 2;
public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress) public long TryUpdateProgress(IDictionary<string, string> metadata, long oldProgress)
{ {

View file

@ -24,10 +24,10 @@ public interface IQuest
/// <summary> /// <summary>
/// Completed Emoji /// Completed Emoji
/// </summary> /// </summary>
public const string COMPLETED = "\\✅"; public const string COMPLETED = "✅";
/// <summary> /// <summary>
/// Incomplete Emoji /// Incomplete Emoji
/// </summary> /// </summary>
public const string INCOMPLETE = "\\❌"; public const string INCOMPLETE = "❌";
} }

View file

@ -36,7 +36,8 @@ public class Owner(VoteRewardService vrs) : EllieModule
var batch = users[currentIndex..(currentIndex += 50)]; var batch = users[currentIndex..(currentIndex += 50)];
var mentions = batch.Select(x => x.Mention).Join(" "); var mentions = batch.Select(x => x.Mention).Join(" ");
await ctx.Channel.SendMessageAsync(mentions, allowedMentions: AllowedMentions.All); var msg = await ctx.Channel.SendMessageAsync(mentions, allowedMentions: AllowedMentions.All);
msg.DeleteAfter(3);
} }
catch catch
{ {

View file

@ -236,6 +236,7 @@ public partial class Utility
} }
[Cmd]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
public async Task QuoteAdd(string keyword, [Leftover] string text) public async Task QuoteAdd(string keyword, [Leftover] string text)
{ {

View file

@ -133,9 +133,9 @@ public sealed class BotCredsProvider : IBotCredsProvider
if (File.Exists(CREDS_FILE_NAME)) if (File.Exists(CREDS_FILE_NAME))
{ {
var creds = Yaml.Deserializer.Deserialize<Creds>(File.ReadAllText(CREDS_FILE_NAME)); var creds = Yaml.Deserializer.Deserialize<Creds>(File.ReadAllText(CREDS_FILE_NAME));
if (creds.Version < 21) if (creds.Version < 22)
{ {
creds.Version = 21; creds.Version = 22;
File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds)); File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds));
} }
} }

View file

@ -1242,7 +1242,7 @@
"linkfix_not_found": "No link fix found for {0}.", "linkfix_not_found": "No link fix found for {0}.",
"notify_cant_set": "This event doesn't support origin channel, Please specify a channel", "notify_cant_set": "This event doesn't support origin channel, Please specify a channel",
"vote_reward": "Thank you for voting! You've received {0}.", "vote_reward": "Thank you for voting! You've received {0}.",
"vote_suggest": "Voting for the bot once every 6 hours will get you {0}!", "vote_suggest": "Voting for the bot will get you {0}!",
"vote_disabled": "Voting is disabled.", "vote_disabled": "Voting is disabled.",
"quest_log": "Quest Log", "quest_log": "Quest Log",
"dailies_done": "You've completed your dailies!", "dailies_done": "You've completed your dailies!",