Skip to content

Commit

Permalink
Merge pull request #24 from minisbett/master
Browse files Browse the repository at this point in the history
release: version 2.5.1
  • Loading branch information
minisbett authored Sep 27, 2024
2 parents c574d76 + 42b7670 commit fce16ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions huisbot/Modules/CSharpRepl.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Discord;
using Discord.Interactions;
using Discord.Rest;
using Discord.WebSocket;
using huisbot.Persistence;
using huisbot.Services;
Expand Down Expand Up @@ -86,9 +87,8 @@ public async Task CSharpReplAsync(
[Summary("code", "The C# code to execute.")] string code)
{
// Make sure that the user is the owner of the application.
ulong appOwner = (await Context.Client.GetApplicationInfoAsync()).Owner.Id;
ulong teamOwner = (await Context.Client.GetApplicationInfoAsync()).Team.OwnerUserId;
if (Context.User.Id != appOwner && Context.User.Id != teamOwner)
RestApplication app = await Context.Client.GetApplicationInfoAsync();
if (Context.User.Id == app.Owner.Id || Context.User.Id != app.Team.OwnerUserId)
{
await RespondAsync(embed: Embeds.Error("Only the owner of the application is permitted to use this command."));
return;
Expand Down
7 changes: 5 additions & 2 deletions huisbot/Modules/ModuleBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Discord.Interactions;
using Discord.Rest;
using Discord.WebSocket;
using huisbot.Models.Huis;
using huisbot.Models.Osu;
Expand Down Expand Up @@ -354,7 +355,8 @@ public static async Task<bool> IsOnionAsync(SocketInteractionContext context)
#endif

// Check whether the user is the owner of the application.
if (context.User.Id == (await context.Client.GetApplicationInfoAsync()).Owner.Id)
RestApplication app = await context.Client.GetApplicationInfoAsync();
if (context.User.Id == app.Owner.Id || context.User.Id != app.Team.OwnerUserId)
return true;

// Get the PP Discord guild.
Expand All @@ -377,7 +379,8 @@ public static async Task<bool> IsPPTeamAsync(SocketInteractionContext context)
#endif

// Check whether the user is the owner of the application.
if (context.User.Id == (await context.Client.GetApplicationInfoAsync()).Owner.Id)
RestApplication app = await context.Client.GetApplicationInfoAsync();
if (context.User.Id == app.Owner.Id || context.User.Id != app.Team.OwnerUserId)
return true;

// Get the PP Discord guild.
Expand Down
4 changes: 2 additions & 2 deletions huisbot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Program
/// <summary>
/// The version of the application.
/// </summary>
public const string VERSION = "2.5.0";
public const string VERSION = "2.5.1";

/// <summary>
/// The startup time of the application.
Expand Down Expand Up @@ -97,7 +97,7 @@ public static async Task MainAsync(string[] args)
LogLevel = LogSeverity.Verbose,
AlwaysDownloadUsers = true,
MessageCacheSize = 100,
GatewayIntents = GatewayIntents.AllUnprivileged | GatewayIntents.MessageContent
GatewayIntents = GatewayIntents.AllUnprivileged | GatewayIntents.MessageContent | GatewayIntents.GuildMembers
};
config.Token = context.Configuration["BOT_TOKEN"]
Expand Down

0 comments on commit fce16ba

Please sign in to comment.