diff --git a/changelog.d/3248.misc.rst b/changelog.d/3248.misc.rst new file mode 100644 index 000000000..aa57d9636 --- /dev/null +++ b/changelog.d/3248.misc.rst @@ -0,0 +1 @@ +fix a buggy first page of paginated help diff --git a/redbot/core/commands/help.py b/redbot/core/commands/help.py index 1de10cfb6..8204c7d8f 100644 --- a/redbot/core/commands/help.py +++ b/redbot/core/commands/help.py @@ -277,16 +277,18 @@ class RedHelpFormatter: ret = [] current_count = 0 - for f in fields: + for i, f in enumerate(fields): f_len = len(f.value) + len(f.name) - if curr_group and (f_len + current_count > max_chars): + + # Commands start at the 1st index of fields, i < 2 is a hacky workaround for now + if not current_count or f_len + current_count > max_chars or i < 2: + current_count += f_len + curr_group.append(f) + elif curr_group: ret.append(curr_group) - curr_group = [] current_count = 0 - curr_group.append(f) - current_count += f_len + curr_group = [f] else: - # Loop cleanup here if curr_group: ret.append(curr_group)