Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ max_line_length = 120
end_of_line = crlf
insert_final_newline = true

# Visual Studio
# Visual Studio
csharp_style_namespace_declarations = file_scoped # Use file scoped namespace by default for new class files

### Naming styles ###
Expand Down Expand Up @@ -46,11 +46,11 @@ dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = stat

dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
dotnet_naming_symbols.private_or_internal_field.required_modifiers =

dotnet_naming_symbols.local.applicable_kinds = local
dotnet_naming_symbols.local.applicable_accessibilities = local
dotnet_naming_symbols.local.required_modifiers =
dotnet_naming_symbols.local.required_modifiers =

dotnet_naming_symbols.constant_field.applicable_kinds = field
dotnet_naming_symbols.constant_field.applicable_accessibilities = *
Expand All @@ -59,18 +59,18 @@ dotnet_naming_symbols.constant_field.required_modifiers = const
# Naming styles

dotnet_naming_style._fieldname.required_prefix = _
dotnet_naming_style._fieldname.required_suffix =
dotnet_naming_style._fieldname.word_separator =
dotnet_naming_style._fieldname.required_suffix =
dotnet_naming_style._fieldname.word_separator =
dotnet_naming_style._fieldname.capitalization = camel_case

dotnet_naming_style.camelcase.required_prefix =
dotnet_naming_style.camelcase.required_suffix =
dotnet_naming_style.camelcase.word_separator =
dotnet_naming_style.camelcase.required_prefix =
dotnet_naming_style.camelcase.required_suffix =
dotnet_naming_style.camelcase.word_separator =
dotnet_naming_style.camelcase.capitalization = camel_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

### Stylecop rules ###
Expand All @@ -87,6 +87,7 @@ dotnet_diagnostic.sa1101.severity = none # Prefix local calls with this
dotnet_diagnostic.sa1200.severity = none # Using directive should appear within a namespace declaration
dotnet_diagnostic.sa1201.severity = suggestion # Elements should appear in the correct order
dotnet_diagnostic.sa1202.severity = suggestion # Elements should be ordered by access
dotnet_diagnostic.sa1204.severity = suggestion # Static members should appear before non-static members

# Naming

Expand All @@ -102,13 +103,16 @@ dotnet_diagnostic.sa1402.severity = suggestion # File may only contain a single
dotnet_diagnostic.sa1502.severity = none # Element should not be on a single line
dotnet_diagnostic.sa1503.severity = none # Braces should not be omitted
dotnet_diagnostic.sa1515.severity = suggestion # Single-line comment should be preceded by blank line

# Documentation

dotnet_diagnostic.sa1600.severity = none # Elements should be documented
dotnet_diagnostic.sa1601.severity = none # Partial elements should be documented
dotnet_diagnostic.sa1602.severity = none # Enumeration items should be documented
dotnet_diagnostic.sa1611.severity = none # Element parameter should be documented
dotnet_diagnostic.sa1615.severity = none # Element return value should be documented
dotnet_diagnostic.sa1623.severity = none # The property's documentation summary text should begin with: 'Gets or sets'
dotnet_diagnostic.sa1629.severity = none # Documentation text should end with a period
dotnet_diagnostic.sa1633.severity = none # File should have header
dotnet_diagnostic.sa1649.severity = none # File name should match first type name

Expand Down Expand Up @@ -186,7 +190,7 @@ resharper_csharp_wrap_extends_list_style = chop_always
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_for_built_in_types = use_var_when_evident
resharper_for_other_types = use_var_when_evident
resharper_instance_members_qualify_declared_in =
resharper_instance_members_qualify_declared_in =
resharper_keep_existing_embedded_block_arrangement = false
resharper_keep_existing_enum_arrangement = false
resharper_nested_ternary_style = expanded
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
workflow: GitHubFlow/v1
workflow: TrunkBased/preview1
assembly-informational-format: '{FullSemVer}'
major-version-bump-message: "^(build|chore|ci|docs|feat|feature|fix|bug|bugfix|perf|refactor|revert|style|test)(\\([\\w\\s-,/\\\\]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat|feature)(\\([\\w\\s-,/\\\\]*\\))?(:|/)"
Expand Down
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
build:
context: ..
dockerfile: src/Kattbot/Dockerfile
tty: true
environment:
- DOTNET_ENVIRONMENT=Development
env_file:
Expand Down
14 changes: 7 additions & 7 deletions src/Kattbot.Common/Models/KattGpt/ChatCompletionCreateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ public record ChatCompletionCreateRequest
/// <summary>
/// A list of tools the model may call. Currently, only functions are supported as a tool.
/// Use this to provide a list of functions the model may generate JSON inputs for.
/// A max of 128 functions are supported.
/// A max of 128 functions is supported.
/// https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools
/// </summary>
[JsonPropertyName("tools")]
public ChatCompletionTool[]? Tools { get; set; }

/// <summary>
/// Controls which (if any) tool is called by the model.
/// none means the model will not call any tool and instead generates a message.
/// auto means the model can pick between generating a message or calling one or more tools.
/// required means the model must call one or more tools.
/// - "none" means the model will not call any tool and instead generates a message.
/// - "auto" means the model can pick between generating a message or calling one or more tools.
/// - "required" means the model must call one or more tools.
/// Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}}
/// forces the model to call that tool.
/// none is the default when no tools are present. auto is the default if tools are present.
/// "none" is the default when no tools are present. "auto" is the default if tools are present.
/// https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
/// </summary>
[JsonPropertyName("tool_choice")]
public StringOrObject<ChatCompletionToolChoice> ToolChoice { get; set; }
public StringOrObject<ChatCompletionToolChoice>? ToolChoice { get; set; }

/// <summary>
/// Whether to enable parallel function calling during tool use.
Expand Down Expand Up @@ -135,4 +135,4 @@ public record ChatCompletionCreateRequest
/// </summary>
[JsonPropertyName("user")]
public string? User { get; set; }
}
}
11 changes: 5 additions & 6 deletions src/Kattbot.Data/Repositories/EmotesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ public async Task RemoveEmoteEntity(EmoteEntity emote)
await _dbContext.SaveChangesAsync();
}

public Task<EmoteEntity> GetExistingEntity(EmoteEntity entity)
private Task<EmoteEntity?> GetExistingEntity(EmoteEntity entity)
{
Task<EmoteEntity?> emote = _dbContext.Emotes.AsQueryable()
.Where(
e => e.EmoteId == entity.EmoteId
&& e.MessageId == entity.MessageId
&& e.UserId == entity.UserId
&& e.GuildId == entity.GuildId)
.Where(e => e.EmoteId == entity.EmoteId
&& e.MessageId == entity.MessageId
&& e.UserId == entity.UserId
&& e.GuildId == entity.GuildId)
.FirstOrDefaultAsync();

return emote;
Expand Down
2 changes: 1 addition & 1 deletion src/Kattbot/Attributes/RequireOwnerOrFriend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override async Task<bool> ExecuteCheckAsync(CommandContext ctx, bool help

DiscordApplication botApp = ctx.Client.CurrentApplication;

bool isBotOwner = botApp.Owners.Any(x => x.Id == userId);
bool isBotOwner = botApp.Owners?.Any(x => x.Id == userId) ?? false;

if (isBotOwner)
{
Expand Down
91 changes: 0 additions & 91 deletions src/Kattbot/CommandHandlers/Images/DallePrompt.cs

This file was deleted.

64 changes: 0 additions & 64 deletions src/Kattbot/CommandHandlers/Images/DallifyImageBase.cs

This file was deleted.

70 changes: 0 additions & 70 deletions src/Kattbot/CommandHandlers/Images/DallifyImageEmote.cs

This file was deleted.

Loading