ZumitoTeam / zumito-bot

Discord Bot
GNU General Public License v3.0
4 stars 1 forks source link

Sweep: Improve command list formatting #132

Closed sweep-ai[bot] closed 4 months ago

sweep-ai[bot] commented 4 months ago

Description

This pull request introduces improvements to the command list formatting within the help command, making the display of commands more consistent and visually appealing.

Summary

Fixes #131.


💡 To get Sweep to edit this pull request, you can:

This is an automated message generated by Sweep AI.

image

sweep-ai[bot] commented 4 months ago

Sweep: PR Review

Authors of pull request: @fernandomema

This pull request improved the formatting of the help command output in the help.ts file to ensure better alignment of command names.

The main change involved modifying the way command names are displayed in the help message. Previously, command names were separated by a fixed number of spaces, which could lead to misalignment. The updated code now dynamically calculates the number of spaces needed to align each command name to a fixed width of 15 characters.

Specifically, the value field in the addFields method was updated to use Array(15 - commands[i]?.name.length).fill(" ").join('') to calculate the required spaces for alignment. This change was applied to both the main help message and the initial values pushed to valuesToPush.

These changes ensure that the help command output is more readable and commands are properly aligned regardless of their name lengths.


Sweep Found These Issues

src/modules/info/commands/help.ts
  • The new code does not handle cases where the command name length exceeds 15 characters, which could lead to misalignment or overflow issues.
  • https://github.com/ZumitoTeam/zumito-bot/blob/fcda7f9d70dee55f6b34cf82dcbe3a0f0d7b618c/src%2Fmodules%2Finfo%2Fcommands%2Fhelp.ts#L104-L122 [View Diff](https://github.com/ZumitoTeam/zumito-bot/pull/132/files#diff-1c63381cf280393707cc589fd088ab9ae27152e44ed80a6ecb04d3fd7934e314R104-R122)