Skip to content

Commit

Permalink
change how commands are handled
Browse files Browse the repository at this point in the history
  • Loading branch information
outerwinnie committed Sep 2, 2024
1 parent 4abecfa commit eb74922
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ static async Task Main(string[] args)
if (string.IsNullOrEmpty(token) || string.IsNullOrEmpty(channelIdStr) || string.IsNullOrEmpty(_fileId) || string.IsNullOrEmpty(_credentialsPath) || string.IsNullOrEmpty(postTimeStr))
{
Console.WriteLine("Environment variables are not set correctly.");
Console.WriteLine($"DISCORD_BOT_TOKEN: {(string.IsNullOrEmpty(token) ? "Not set" : "Set")}");
Console.WriteLine($"DISCORD_CHANNEL_ID: {(string.IsNullOrEmpty(channelIdStr) ? "Not set" : "Set")}");
Console.WriteLine($"GOOGLE_DRIVE_FILE_ID: {(string.IsNullOrEmpty(_fileId) ? "Not set" : "Set")}");
Console.WriteLine($"GOOGLE_CREDENTIALS_PATH: {(string.IsNullOrEmpty(_credentialsPath) ? "Not set" : "Set")}");
Console.WriteLine($"POST_TIME: {(string.IsNullOrEmpty(postTimeStr) ? "Not set" : "Set")}");
return;
}

Expand Down Expand Up @@ -130,7 +125,7 @@ private static async Task OnReady()
private static async Task RegisterCommandsAsync()
{
// Add commands to the CommandService
await _commands.AddModulesAsync(typeof(Program).Assembly, _services);
await _commands.AddModuleAsync<ImageCommands>(null);
}

private static async Task HandleCommandAsync(SocketMessage arg)
Expand Down Expand Up @@ -234,7 +229,6 @@ private static async Task PostRandomImageUrl()
}
}

[Group("image")]
public class ImageCommands : ModuleBase<SocketCommandContext>
{
[Command("send")]
Expand Down

0 comments on commit eb74922

Please sign in to comment.