Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

major: various fixes, codebase improvements/cleanup, packages/sdk update #3

Merged
merged 74 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ea978ca
chore: add usernames for authorized discord user ids
bryanpth Sep 2, 2024
cf6f2f0
chore: add missing `readonly` modifiers for immutable fields
bryanpth Sep 2, 2024
428a158
chore: remove unused exception variable
bryanpth Sep 2, 2024
8396abb
refactor: make methods static where applicable
bryanpth Sep 2, 2024
658ec84
refactor: use null-coalescing assignment where applicable
bryanpth Sep 2, 2024
11141cd
refactor: use standard C# constructor for new string creation
bryanpth Sep 2, 2024
1644d59
refactor: use single quote when searching for a single character
bryanpth Sep 2, 2024
d8ee804
fix: typo `contributers` to `contributors`
bryanpth Sep 2, 2024
5053572
refactor: update `/help` command embed
bryanpth Sep 2, 2024
bac8e84
refactor: simplify object instantiation with target-typed `new()`
bryanpth Sep 2, 2024
bbe40cf
refactor: use pattern matching
bryanpth Sep 2, 2024
6d63985
chore: update `/help` command description
bryanpth Sep 2, 2024
cf2086c
refactor: update `/serverstats` command embed
bryanpth Sep 2, 2024
8ca2340
refactor: update ChannelInfoModule.cs
bryanpth Sep 2, 2024
4be51b5
refactor: update PaginatorServices.cs
bryanpth Sep 2, 2024
b6ec62b
refactor: update LogService.cs
bryanpth Sep 2, 2024
4dbe3ca
refactor: update DevModule.cs
bryanpth Sep 2, 2024
f4f12eb
refactor: update TelemetryModule.cs
bryanpth Sep 2, 2024
7984834
refactor: update StagingModule.cs
bryanpth Sep 2, 2024
bf98b20
chore: rename various lambda parameters for clarity
bryanpth Sep 2, 2024
349ada4
refactor: update GLModule.cs
bryanpth Sep 2, 2024
94bbce8
refactor: update GLService.cs
bryanpth Sep 2, 2024
a333c82
refactor: update moderation service/module
bryanpth Sep 2, 2024
76b8af8
docs: update README.md
bryanpth Sep 2, 2024
24e8f31
chore: remove kibble user id from authorized users lists
bryanpth Sep 4, 2024
beaf207
fix: suppress non-awaited warnings
bryanpth Sep 4, 2024
db5aa29
refactor: update profile command embed
bryanpth Sep 4, 2024
9ef46f1
refactor update stats command embed
bryanpth Sep 4, 2024
b8bc28c
add missing `readonly` modifiers
bryanpth Sep 4, 2024
30c3658
feat: replace `setGameAsync` with `setActivctyAsync` for the bot rich…
bryanpth Sep 4, 2024
d0979d0
refactor: use switch expression instead of if else statement
bryanpth Sep 4, 2024
0e68d60
docs: add line break in README.md
bryanpth Sep 4, 2024
d66cc2b
style: remove unnecessary blank line
bryanpth Sep 4, 2024
fa617fb
chore: add my user id in authorized users ids
bryanpth Sep 4, 2024
e4ed959
Update src/AdvancedBot.Core/Commands/Modules/ModerationModule.cs
svr333 Sep 4, 2024
21568f0
Update src/AdvancedBot.Core/Commands/Modules/ModerationModule.cs
svr333 Sep 4, 2024
5d135da
revert: "Update src/AdvancedBot.Core/Commands/Modules/ModerationModul…
bryanpth Sep 6, 2024
f862335
revert: "Update src/AdvancedBot.Core/Commands/Modules/ModerationModul…
bryanpth Sep 6, 2024
aa40f54
fix: remove unused directive
bryanpth Sep 6, 2024
3646cf2
chore: merge branch 'master' into 'refactor/cleanup'
bryanpth Sep 6, 2024
41ae990
bump: update .NET, C# and packages versions
bryanpth Sep 7, 2024
90265fc
ci: update .NET version to 8 on workflows
bryanpth Sep 7, 2024
6372ffc
refactor: update obsolete attribute
bryanpth Sep 7, 2024
ba0b79e
fix: command stopped working in DM
bryanpth Sep 7, 2024
a56f37b
refactor: update string comparison to use .Equals
bryanpth Sep 7, 2024
70f4a12
feat: use GetDisplayAvatarUrl() for avatar retrieving
bryanpth Sep 7, 2024
26e0c7d
fix: properly returning if same player were compared
bryanpth Sep 7, 2024
647c954
ci: remove dashboard workflow
bryanpth Sep 7, 2024
9d0cfff
cleanup: delete `AdvancedBot.Dashboard` project
bryanpth Sep 7, 2024
52e45ee
refactor: use top-level statement
bryanpth Sep 7, 2024
088b0d8
refactor: update "serverstats" command embed response
bryanpth Sep 7, 2024
cc2e913
fix: pagination not working in DM
bryanpth Sep 7, 2024
dcaae0d
chore: update leaderboards commands responses
bryanpth Sep 7, 2024
61f634a
fix: typo in leaderboard embed footer
bryanpth Sep 10, 2024
b46ea1f
chore: add thumbnail & footer to moderation leaderboard cmd embed
bryanpth Sep 10, 2024
eeee802
chore: run codecleanup
bryanpth Sep 27, 2024
adc04f7
chore: remove obsolete methods
bryanpth Sep 27, 2024
cf15227
chore: add .editorconfig
bryanpth Sep 27, 2024
b15e886
style: format codebase to improve code quality
bryanpth Sep 27, 2024
6957ea6
ci: refactor continuous integration
bryanpth Sep 27, 2024
ced070b
fix(ci): prevent duplicated workflow on pull requests
bryanpth Sep 27, 2024
5460b6f
chore: add .gitattributes file
bryanpth Sep 27, 2024
aec8011
bump: update to C# 12
bryanpth Sep 27, 2024
b1767a7
bump: update Discord.NET to 3.16.0
bryanpth Sep 27, 2024
56dc809
refactor: simplify lists/collections initialization
bryanpth Sep 27, 2024
4d54e66
fix(embed): update emote as someone renamed them on gl server
bryanpth Sep 27, 2024
8354a51
feat: use collection expression for embeds
bryanpth Sep 27, 2024
fd61045
chore: update reset failed response message
bryanpth Sep 27, 2024
dcfdc1b
chore: update profiles embed titles for consistency
bryanpth Sep 27, 2024
0b13366
chore: simplify ServiceCollectionExt.cs
bryanpth Sep 27, 2024
7f79ad8
chore: format changes on PrefixCheckerExt.cs
bryanpth Sep 27, 2024
e62b1c8
chore: prefer file scoped namespace
bryanpth Sep 27, 2024
a6d4eba
chore: ensure codebase match updated preferences
bryanpth Sep 27, 2024
a3f6d21
chore: ensure codebase match updated preferences
bryanpth Sep 27, 2024
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
199 changes: 199 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# EditorConfig is awesome: http://editorconfig.org
root = true

[*.{csproj,props,targets}]
charset = utf-8-bom
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[g_*.cs]
generated_code = true

[*.cs]
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

# Roslyn naming styles

# PascalCase for public and protected members
dotnet_naming_style.pascalcase.capitalization = pascal_case
dotnet_naming_symbols.public_members.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_members.applicable_kinds = property,method,field,event
dotnet_naming_rule.public_members_pascalcase.severity = error
dotnet_naming_rule.public_members_pascalcase.symbols = public_members
dotnet_naming_rule.public_members_pascalcase.style = pascalcase

# camelCase for private members
dotnet_naming_style.camelcase.capitalization = camel_case

dotnet_naming_symbols.private_members.applicable_accessibilities = private
dotnet_naming_symbols.private_members.applicable_kinds = property,method,field,event
dotnet_naming_rule.private_members_camelcase.severity = warning
dotnet_naming_rule.private_members_camelcase.symbols = private_members
dotnet_naming_rule.private_members_camelcase.style = camelcase

dotnet_naming_symbols.local_function.applicable_kinds = local_function
dotnet_naming_rule.local_function_camelcase.severity = warning
dotnet_naming_rule.local_function_camelcase.symbols = local_function
dotnet_naming_rule.local_function_camelcase.style = camelcase

# all_lower for private and local constants/static readonlys
dotnet_naming_style.all_lower.capitalization = all_lower
dotnet_naming_style.all_lower.word_separator = _

dotnet_naming_symbols.private_constants.applicable_accessibilities = private
dotnet_naming_symbols.private_constants.required_modifiers = const
dotnet_naming_symbols.private_constants.applicable_kinds = field
dotnet_naming_rule.private_const_all_lower.severity = warning
dotnet_naming_rule.private_const_all_lower.symbols = private_constants
dotnet_naming_rule.private_const_all_lower.style = all_lower

dotnet_naming_symbols.private_static_readonly.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly.required_modifiers = static,readonly
dotnet_naming_symbols.private_static_readonly.applicable_kinds = field
dotnet_naming_rule.private_static_readonly_all_lower.severity = warning
dotnet_naming_rule.private_static_readonly_all_lower.symbols = private_static_readonly
dotnet_naming_rule.private_static_readonly_all_lower.style = all_lower

dotnet_naming_symbols.local_constants.applicable_kinds = local
dotnet_naming_symbols.local_constants.required_modifiers = const
dotnet_naming_rule.local_const_all_lower.severity = warning
dotnet_naming_rule.local_const_all_lower.symbols = local_constants
dotnet_naming_rule.local_const_all_lower.style = all_lower

# ALL_UPPER for non private constants/static readonlys
dotnet_naming_style.all_upper.capitalization = all_upper
dotnet_naming_style.all_upper.word_separator = _

dotnet_naming_symbols.public_constants.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_constants.required_modifiers = const
dotnet_naming_symbols.public_constants.applicable_kinds = field
dotnet_naming_rule.public_const_all_upper.severity = warning
dotnet_naming_rule.public_const_all_upper.symbols = public_constants
dotnet_naming_rule.public_const_all_upper.style = all_upper

dotnet_naming_symbols.public_static_readonly.applicable_accessibilities = public,internal,protected,protected_internal,private_protected
dotnet_naming_symbols.public_static_readonly.required_modifiers = static,readonly
dotnet_naming_symbols.public_static_readonly.applicable_kinds = field
dotnet_naming_rule.public_static_readonly_all_upper.severity = warning
dotnet_naming_rule.public_static_readonly_all_upper.symbols = public_static_readonly
dotnet_naming_rule.public_static_readonly_all_upper.style = all_upper

# Roslyn formating options

# Formatting - indentation options
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true

# Formatting - new line options
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_open_brace = all
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_between_query_expression_clauses = true

# Formatting - organize using options
dotnet_sort_system_directives_first = true

# Formatting - spacing options
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false

# Formatting - wrapping options
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

# Roslyn language styles

# Style - this. qualification
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning

# Style - type names
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
csharp_style_var_when_type_is_apparent = true:none
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_elsewhere = true:silent

# Style - modifiers
dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
csharp_preferred_modifier_order = public,private,protected,internal,new,abstract,virtual,sealed,override,static,readonly,extern,unsafe,volatile,async:warning

# Style - expression bodies
csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = true:warning
csharp_style_expression_bodied_properties = true:warning
csharp_style_expression_bodied_local_functions = true:silent

# Style - expression preferences
dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_compound_assignment = true:warning

# Style - null/type checks
dotnet_style_coalesce_expression = true:warning
dotnet_style_null_propagation = true:warning
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_throw_expression = true:silent
csharp_style_conditional_delegate_call = true:warning

# Style - unused
dotnet_style_readonly_field = true:silent
dotnet_code_quality_unused_parameters = non_public:silent
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_unused_value_assignment_preference = discard_variable:warning

# Style - variable declaration
csharp_style_inlined_variable_declaration = true:warning
csharp_style_deconstructed_variable_declaration = false:silent

# Style - other C# 7.x features
dotnet_style_prefer_inferred_tuple_names = true:warning
csharp_prefer_simple_default_expression = true:warning
csharp_style_pattern_local_over_anonymous_function = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent

# Style - C# 8 features
csharp_prefer_static_local_function = true:warning
csharp_prefer_simple_using_statement = true:silent
csharp_style_prefer_index_operator = false:silent
csharp_style_prefer_range_operator = false:silent
csharp_style_prefer_switch_expression = false:none

csharp_style_namespace_declarations = file_scoped:warning

# Style - C# 12 features
csharp_style_prefer_primary_constructors = false

[*.{yaml,yml}]
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
25 changes: 25 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Autodetect text files and ensure that we normalise their
# line endings to lf internally. When checked out they may
# use different line endings.
* text=auto

# Check out with crlf (Windows) line endings
*.sln text eol=crlf
*.csproj text eol=crlf
*.cs text diff=csharp eol=crlf
*.resx text eol=crlf
*.vsixmanifest text eol=crlf
packages.config text eol=crlf
App.config text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.snippet text eol=crlf
*.manifest text eol=crlf
*.licenseheader text eol=crlf

# Check out with lf (UNIX) line endings
*.sh text eol=lf
.gitignore text eol=lf
.gitattributes text eol=lf
*.md text eol=lf
.travis.yml text eol=lf
43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8

- name: Format
working-directory: src
run: |
dotnet format --verify-no-changes --verbosity diagnostic

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8

- name: Compile
working-directory: src/AdvancedBot.Console
run: |
dotnet build -c Release -warnaserror
24 changes: 0 additions & 24 deletions .github/workflows/console.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/dashboard.yaml

This file was deleted.

52 changes: 26 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/AdvancedBot.Console/bin/Debug/net7.0/AdvancedBot.Console.dll",
"args": [],
"cwd": "${workspaceFolder}/src/AdvancedBot.Console",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/AdvancedBot.Console/bin/Debug/net8.0/AdvancedBot.Console.dll",
"args": [],
"cwd": "${workspaceFolder}/src/AdvancedBot.Console",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
Loading