-
-
Notifications
You must be signed in to change notification settings - Fork 4
List all member by API #113
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
Conversation
Bumps [aiohappyeyeballs](https://github.com/aio-libs/aiohappyeyeballs) from 2.3.5 to 2.4.0. - [Release notes](https://github.com/aio-libs/aiohappyeyeballs/releases) - [Changelog](https://github.com/aio-libs/aiohappyeyeballs/blob/main/CHANGELOG.md) - [Commits](aio-libs/aiohappyeyeballs@v2.3.5...v2.4.0) --- updated-dependencies: - dependency-name: aiohappyeyeballs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.3 to 3.10.5. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](aio-libs/aiohttp@v3.10.3...v3.10.5) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.3 to 3.0.4. - [Release notes](https://github.com/pallets/werkzeug/releases) - [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst) - [Commits](pallets/werkzeug@3.0.3...3.0.4) --- updated-dependencies: - dependency-name: werkzeug dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Change-Id: If9b79f4a3d4bd194291dd2293ba564a3aea65012
|
Warning Rate limit exceeded@winstonsung has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 15 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ## Walkthrough
A new GitHub Actions workflow for automated code formatting using Black has been implemented, along with a minor update to the Pylint workflow name for consistency. The `pyproject.toml` file now specifies a version for Black, while multiple new dependencies have been introduced in `requirements_dev.txt`. Additionally, various Python files have been reformatted for improved readability, maintaining their existing functionality.
## Changes
| File | Change Summary |
|-------------------------------------------|-----------------------------------------------------------------------------|
| `.github/workflows/black.yml` | New workflow for automated code formatting using Black added. |
| `.github/workflows/pylint.yml` | Job name updated to "Analysing the code with Pylint." |
| `pyproject.toml` | Added dependency `"black == 24.8.0"` to `optional-dependencies.dev`. |
| `requirements_dev.txt` | Added new dependencies: `black`, `click`, `mypy-extensions`, and `pathspec`. |
| Multiple Python files | Various files reformatted for consistency and readability. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Developer
participant GitHubActions
participant CodeFormatter
Developer->>GitHubActions: Push code
GitHubActions->>CodeFormatter: Trigger Black formatting
CodeFormatter-->>GitHubActions: Format code
GitHubActions->>Developer: Commit formatted codePoem
New changesetsapp.py: ## AI-generated summary of changes The provided diff introduces several enhancements and modifications to the Upon successful session validation, the function retrieves the user's ID from the session and constructs an authorization header using the Discord bot token. It then makes an API call to fetch user data from a specific guild. If the request fails (indicated by a non-200 status code), the function responds with an error message and the corresponding status code. Additionally, the function checks if the user possesses a specific role ( Moreover, the diff includes various formatting improvements throughout the code, such as consistent spacing around operators and parameters, which enhances readability. Several error handling responses have been standardized to provide clearer messages in case of failures, particularly in the These changes collectively enhance the application's functionality by integrating with the Discord API, improving error handling, and ensuring a more readable and maintainable codebase. Alterations to the declarations of exported or public entities
New changesets.github/workflows/black.yml: ## AI-generated summary of changes The newly introduced GitHub Actions workflow file, The workflow begins by checking out the repository's code with the Once the environment is prepared, the workflow formats the code by running the Black formatter on all Python files in the repository. This is accomplished through a command that identifies files with the The workflow concludes with a step that automatically stages and commits any changes made by Black back to the repository. This step generates a commit message that references the last commit, indicating that formatting has been applied. Overall, this workflow significantly streamlines the development process by integrating automated code formatting, minimizing the need for manual formatting efforts, and maintaining code quality throughout the project's lifecycle. Alterations to the declarations of exported or public entities
--> Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Files selected for processing (6)
- .github/workflows/black.yml (1 hunks)
- .github/workflows/pylint.yml (1 hunks)
- app.py (1 hunks)
- pyproject.toml (1 hunks)
- requirements.txt (2 hunks)
- requirements_dev.txt (1 hunks)
Additional context used
actionlint
.github/workflows/black.yml
26-26: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
29-29: shellcheck reported issue in this script: SC2035:info:1:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
Ruff
app.py
59-59: Missing return type annotation for public function
listt(ANN201)
65-65: Trailing comma missing
Add trailing comma
(COM812)
76-76: Trailing comma missing
Add trailing comma
(COM812)
79-79: Trailing comma missing
Add trailing comma
(COM812)
Additional comments not posted (9)
requirements_dev.txt (4)
2-2: Purrfect addition ofblackfor code formatting!Adding
blackwill help maintain consistent code style across the project.
3-3:clickis a pawsome choice for CLI creation!Including
clickcan simplify command-line interface development.
9-9:mypy-extensionswill make type hinting meow-nificent!Adding
mypy-extensionsenhances type checking capabilities.
11-11:pathspecis a claw-some addition for file path matching!This will be useful for specifying file patterns, especially with tools like
black.requirements.txt (3)
1-1: Upgradingaiohappyeyeballsis a purr-suasive choice!The new version may include performance improvements or bug fixes.
2-2:aiohttpupdate is pawsitively beneficial!Keeping
aiohttpup-to-date ensures compatibility and access to the latest features.
22-22:werkzeugupgrade is meow-velous!This minor version bump likely includes important fixes or enhancements.
.github/workflows/pylint.yml (1)
25-25: Capitalization change is purr-fectly consistent!This improves readability and aligns with proper noun formatting.
pyproject.toml (1)
39-39: LGTM! Black dependency added successfully.The addition of
"black == 24.8.0"to theoptional-dependencies.devsection is appropriate and aligns with the project's goals for consistent code formatting.
662056d to
c0a6465
Compare
|
Rebase! Rebase! Rebase! Don't create merge commits! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Files selected for processing (4)
- .github/workflows/black.yml (1 hunks)
- .github/workflows/pylint.yml (1 hunks)
- pyproject.toml (1 hunks)
- requirements_dev.txt (1 hunks)
Additional context used
actionlint
.github/workflows/black.yml
26-26: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
29-29: shellcheck reported issue in this script: SC2035:info:1:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
Additional comments not posted (5)
requirements_dev.txt (1)
2-3: Purrrfect additions for development!The additions of
black,click,mypy-extensions, andpathspecenhance the development environment by improving code quality and consistency. These tools are widely used and beneficial for maintaining a clean codebase.Also applies to: 9-11
.github/workflows/pylint.yml (1)
25-25: Consistency is key!The update to capitalize "Pylint" in the job name improves readability and aligns with naming conventions. This change is purrfectly fine!
.github/workflows/black.yml (2)
26-26: Quote the command substitution to prevent word splitting.The shellcheck warning suggests quoting the command substitution to prevent unintended word splitting.
Apply this diff to fix the issue:
- black $(git ls-files '*.py') + black "$(git ls-files '*.py')"Tools
actionlint
26-26: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
29-29: Use./*to avoid issues with filenames containing dashes.The shellcheck warning suggests using
./*to prevent filenames with dashes from being interpreted as options.Apply this diff to fix the issue:
- git add * + git add ./*Tools
actionlint
29-29: shellcheck reported issue in this script: SC2035:info:1:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
pyproject.toml (1)
39-39: Purr-fect addition of Black!Adding Black as a development dependency helps maintain consistent code formatting. Make sure everyone on the team is aware of this change to avoid any formatting surprises. 🐾
c0a6465 to
4c21c99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Files selected for processing (4)
- .github/workflows/black.yml (1 hunks)
- .github/workflows/pylint.yml (1 hunks)
- pyproject.toml (1 hunks)
- requirements_dev.txt (1 hunks)
Additional context used
actionlint
.github/workflows/black.yml
26-26: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
29-29: shellcheck reported issue in this script: SC2035:info:3:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
Additional comments not posted (4)
requirements_dev.txt (1)
2-11: Purrfect additions for development!The new dependencies
black,click,mypy-extensions, andpathspecare great choices to enhance code quality and maintainability. 🐾.github/workflows/pylint.yml (1)
25-25: Paws up for consistency!The capitalization of "Pylint" in the job name enhances readability and consistency. 🐾
.github/workflows/black.yml (1)
1-33: A meow-velous new workflow!The new GitHub Actions workflow for Black is well-structured. 🐾
Note: Existing comments address shellcheck issues regarding quoting and globbing. Ensure these are resolved to prevent potential issues.
Tools
actionlint
26-26: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
29-29: shellcheck reported issue in this script: SC2035:info:3:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
pyproject.toml (1)
39-39: Purrfect addition of Black!Adding Black to the development dependencies will help keep the code looking neat and tidy. 🐾
Change-Id: If9b79f4a3d4bd194291dd2293ba564a3aea65012
4c21c99 to
ee7e20f
Compare
Change-Id: If9b79f4a3d4bd194291dd2293ba564a3aea65012
ee7e20f to
62a331e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 20
Outside diff range comments (6)
app.py (6)
Line range hint
48-67: Add return type annotation.Consider adding a return type annotation to the
loginfunction for better clarity.def login() -> Response:
Line range hint
103-226: Refactor to reduce complexity.The
sendfunction is too complex. Consider breaking it down into smaller functions for better readability and maintainability.Tools
Ruff
183-183: Trailing comma missing
Add trailing comma
(COM812)
198-198: Trailing comma missing
Add trailing comma
(COM812)
205-205: Possible SQL injection vector through string-based query construction
(S608)
208-208: Do not catch blind exception:
Exception(BLE001)
214-214: Trailing comma missing
Add trailing comma
(COM812)
216-216: Comment contains ambiguous
:(FULLWIDTH COLON). Did you mean:(COLON)?(RUF003)
220-220: Trailing comma missing
Add trailing comma
(COM812)
223-223: Do not catch blind exception:
Exception(BLE001)
225-225: Trailing comma missing
Add trailing comma
(COM812)
230-230: Missing return type annotation for public function
callback(ANN201)
Line range hint
228-287: Add return type annotation.Consider adding a return type annotation to the
callbackfunction for better clarity.def callback() -> Response:Tools
Ruff
243-243: Probable use of
requestscall without timeout(S113)
244-244: Trailing comma missing
Add trailing comma
(COM812)
252-252: Probable use of
requestscall without timeout(S113)
270-270: Trailing comma missing
Add trailing comma
(COM812)
273-273: Comment contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF003)
285-285: Comment contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF003)
290-290: Missing return type annotation for public function
discord_callback(ANN201)
Line range hint
288-318: Add return type annotation.Consider adding a return type annotation to the
discord_callbackfunction for better clarity.def discord_callback() -> Response:Tools
Ruff
302-302: Probable use of
requestscall without timeout(S113)
303-303: Trailing comma missing
Add trailing comma
(COM812)
309-309: Probable use of
requestscall without timeout(S113)
321-321: Missing return type annotation for public function
staticfiles(ANN201)
321-321: Missing type annotation for function argument
path(ANN001)
326-326: Missing return type annotation for public function
profile(ANN201)
356-356: Missing return type annotation for public function
slot(ANN201)
384-384: Missing return type annotation for public function
product_list(ANN201)
386-386: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
388-388: Unnecessary assignment to
productsbeforereturnstatementRemove unnecessary assignment
(RET504)
392-392: Missing return type annotation for public function
buy_productAdd return type annotation:
str(ANN201)
400-400: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
Line range hint
391-430: Add return type annotation.Consider adding a return type annotation to the
buy_productfunction for better clarity.def buy_product() -> str:Tools
Ruff
302-302: Probable use of
requestscall without timeout(S113)
303-303: Trailing comma missing
Add trailing comma
(COM812)
309-309: Probable use of
requestscall without timeout(S113)
321-321: Missing return type annotation for public function
staticfiles(ANN201)
321-321: Missing type annotation for function argument
path(ANN001)
326-326: Missing return type annotation for public function
profile(ANN201)
356-356: Missing return type annotation for public function
slot(ANN201)
384-384: Missing return type annotation for public function
product_list(ANN201)
386-386: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
388-388: Unnecessary assignment to
productsbeforereturnstatementRemove unnecessary assignment
(RET504)
392-392: Missing return type annotation for public function
buy_productAdd return type annotation:
str(ANN201)
400-400: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
Line range hint
431-478: Add return type annotation.Consider adding a return type annotation to the
roll_slotfunction for better clarity.def roll_slot() -> list:Tools
Ruff
457-457: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
460-460: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
463-465: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
464-464: Trailing comma missing
Add trailing comma
(COM812)
Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Files selected for processing (1)
- app.py (17 hunks)
Additional context used
Ruff
app.py
46-46: Missing return type annotation for public function
not_found_error(ANN201)
46-46: Missing type annotation for function argument
error(ANN001)
46-46: Unused function argument:
error(ARG001)
69-69: Missing return type annotation for public function
logout(ANN201)
75-75: Missing return type annotation for public function
listt(ANN201)
79-79: Trailing comma missing
Add trailing comma
(COM812)
95-95: Trailing comma missing
Add trailing comma
(COM812)
105-105:
sendis too complex (13 > 10)(C901)
105-105: Missing return type annotation for public function
send(ANN201)
105-105: Missing type annotation for function argument
target_user_id(ANN001)
110-110: Trailing comma missing
Add trailing comma
(COM812)
125-125: Trailing comma missing
Add trailing comma
(COM812)
155-155: Trailing comma missing
Add trailing comma
(COM812)
157-157: Do not catch blind exception:
Exception(BLE001)
159-159: Trailing comma missing
Add trailing comma
(COM812)
172-172: Comment contains ambiguous
((FULLWIDTH LEFT PARENTHESIS). Did you mean((LEFT PARENTHESIS)?(RUF003)
172-172: Comment contains ambiguous
)(FULLWIDTH RIGHT PARENTHESIS). Did you mean)(RIGHT PARENTHESIS)?(RUF003)
183-183: Trailing comma missing
Add trailing comma
(COM812)
198-198: Trailing comma missing
Add trailing comma
(COM812)
205-205: Possible SQL injection vector through string-based query construction
(S608)
208-208: Do not catch blind exception:
Exception(BLE001)
214-214: Trailing comma missing
Add trailing comma
(COM812)
216-216: Comment contains ambiguous
:(FULLWIDTH COLON). Did you mean:(COLON)?(RUF003)
220-220: Trailing comma missing
Add trailing comma
(COM812)
223-223: Do not catch blind exception:
Exception(BLE001)
225-225: Trailing comma missing
Add trailing comma
(COM812)
243-243: Probable use of
requestscall without timeout(S113)
244-244: Trailing comma missing
Add trailing comma
(COM812)
252-252: Probable use of
requestscall without timeout(S113)
270-270: Trailing comma missing
Add trailing comma
(COM812)
273-273: Comment contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF003)
285-285: Comment contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF003)
302-302: Probable use of
requestscall without timeout(S113)
303-303: Trailing comma missing
Add trailing comma
(COM812)
309-309: Probable use of
requestscall without timeout(S113)
321-321: Missing return type annotation for public function
staticfiles(ANN201)
321-321: Missing type annotation for function argument
path(ANN001)
326-326: Missing return type annotation for public function
profile(ANN201)
356-356: Missing return type annotation for public function
slot(ANN201)
384-384: Missing return type annotation for public function
product_list(ANN201)
386-386: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
388-388: Unnecessary assignment to
productsbeforereturnstatementRemove unnecessary assignment
(RET504)
392-392: Missing return type annotation for public function
buy_productAdd return type annotation:
str(ANN201)
400-400: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
428-428: String contains ambiguous
!(FULLWIDTH EXCLAMATION MARK). Did you mean!(EXCLAMATION MARK)?(RUF001)
444-444: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
457-457: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
460-460: Unnecessary open mode parameters
Remove open mode parameters
(UP015)
464-464: Trailing comma missing
Add trailing comma
(COM812)
475-475: String contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF001)
484-484: Missing return type annotation for public function
github_login(ANN201)
492-492: Missing return type annotation for public function
github_callback(ANN201)
495-495: Possible hardcoded password assigned to: "token_url"
(S105)
503-503: Probable use of
requestscall without timeout(S113)
511-511: Missing return type annotation for public function
star_uwu(ANN201)
512-512: Missing return type annotation for private function
insert_userAdd return type annotation:
None(ANN202)
512-512: Missing type annotation for function argument
user_id(ANN001)
512-512: Missing type annotation for function argument
table(ANN001)
512-512: Missing type annotation for function argument
cursor(ANN001)
512-512: Comment contains ambiguous
((FULLWIDTH LEFT PARENTHESIS). Did you mean((LEFT PARENTHESIS)?(RUF003)
512-512: Comment contains ambiguous
)(FULLWIDTH RIGHT PARENTHESIS). Did you mean)(RIGHT PARENTHESIS)?(RUF003)
523-523: Trailing comma missing
Add trailing comma
(COM812)
529-529: Probable use of
requestscall without timeout(S113)
546-546: Probable use of
requestscall without timeout(S113)
553-553: Trailing comma missing
Add trailing comma
(COM812)
554-554: Comment contains ambiguous
,(FULLWIDTH COMMA). Did you mean,(COMMA)?(RUF003)
572-572: Use of
debug=Truein Flask app detected(S201)
Additional comments not posted (1)
app.py (1)
110-112: Add trailing comma for better diffs.Adding a trailing comma helps in maintaining cleaner diffs in future changes.
api_admin = session.get( "user", )Likely invalid or redundant comment.
Tools
Ruff
110-110: Trailing comma missing
Add trailing comma
(COM812)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Files selected for processing (1)
- .github/workflows/black.yml (1 hunks)
Additional context used
actionlint
.github/workflows/black.yml
27-27: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
30-30: shellcheck reported issue in this script: SC2035:info:3:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
Additional comments not posted (2)
.github/workflows/black.yml (2)
27-27: Quote the command substitution to prevent word splitting.The shellcheck warning suggests quoting the command substitution to prevent unintended word splitting. This is a common issue when using command substitutions in shell scripts.
- black $(git ls-files '*.py') + black "$(git ls-files '*.py')"Tools
actionlint
27-27: shellcheck reported issue in this script: SC2046:warning:1:7: Quote this to prevent word splitting
(shellcheck)
30-30: Use./*to avoid issues with filenames containing dashes.The shellcheck warning suggests using
./*to prevent filenames with dashes from being interpreted as options. This is a best practice to ensure that filenames are handled correctly.- git add * + git add ./*Tools
actionlint
30-30: shellcheck reported issue in this script: SC2035:info:3:9: Use ./glob or -- glob so names with dashes won't become options
(shellcheck)
Change-Id: If9b79f4a3d4bd194291dd2293ba564a3aea65012
bf26ff8 to
ac8bd26
Compare
git config pull.rebase true |
adde4d6 to
ac8bd26
Compare
|
@winstonsung 你這樣算改好了嗎? |
|
先這樣吧,趕時間 |
|
好了,Black有正常運作了。 |
|
(CI過了就是有正常。) |
|
|
Summary by CodeRabbit
New Features
/api/mlistfor retrieving members from a Discord guild.Updates
Style