[V3 General] Long urban responses error out #2683

Closed
opened 2019-05-16 06:06:48 +02:00 by Injabie3 · 0 comments
Injabie3 commented 2019-05-16 06:06:48 +02:00 (Migrated from github.com)

Command bugs

Command name

[p]urban

What cog is this command from?

General

What were you expecting to happen?

Expect the bot to return the results from the query.

What actually happened?

The command errors out. The traceback indicates that the result message is too long (below). I took a quick look at general.py, and line 311 is setting a value greater than the text limit of 2000 characters. As well, line 314 seems to tack on more, rendering the previous check somewhat useless.

[2019-05-15 20:57:45] [ERROR] red: Exception in command 'urban'
Traceback (most recent call last):
  File "/home/injabie3/github/Rin/lib/python3.7/site-packages/discord.py-1.0.1-py3.7.egg/discord/ext/commands/core.py", line 63, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/injabie3/github/Rin/lib/python3.7/site-packages/Red_DiscordBot-3.1.1-py3.7.egg/redbot/cogs/general/general.py", line 327, in urban
    timeout=30,
  File "/home/injabie3/github/Rin/lib/python3.7/site-packages/Red_DiscordBot-3.1.1-py3.7.egg/redbot/core/utils/menus.py", line 71, in menu
    message = await ctx.send(current_page)
  File "/home/injabie3/github/Rin/lib/python3.7/site-packages/Red_DiscordBot-3.1.1-py3.7.egg/redbot/core/commands/context.py", line 63, in send
    return await super().send(content=content, **kwargs)
  File "/home/injabie3/github/Rin/lib/python3.7/site-packages/discord.py-1.0.1-py3.7.egg/discord/abc.py", line 776, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)
  File "/home/injabie3/github/Rin/lib/python3.7/site-packages/discord.py-1.0.1-py3.7.egg/discord/http.py", line 222, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400): Invalid Form Body
In content: Must be 2000 or fewer in length.

Perhaps lowering the previous character limit above to something more conservative would be better?

How can we reproduce this issue?

  1. Toggle embed results to off (e.g. [p]embedset global)
  2. Run the following [p]urban art student
# Command bugs <!-- Did you find a bug with a command? Fill out the following: --> #### Command name [p]urban #### What cog is this command from? General #### What were you expecting to happen? Expect the bot to return the results from the query. #### What actually happened? The command errors out. The traceback indicates that the result message is too long (below). I took a quick look at `general.py`, and [line 311](https://github.com/Cog-Creators/Red-DiscordBot/blob/79e5d2c9d7d152ff0e5df2e1b19e13075f2a7261/redbot/cogs/general/general.py#L311) is setting a value greater than the text limit of 2000 characters. As well, [line 314](https://github.com/Cog-Creators/Red-DiscordBot/blob/79e5d2c9d7d152ff0e5df2e1b19e13075f2a7261/redbot/cogs/general/general.py#L314) seems to tack on more, rendering the previous check somewhat useless. ``` [2019-05-15 20:57:45] [ERROR] red: Exception in command 'urban' Traceback (most recent call last): File "/home/injabie3/github/Rin/lib/python3.7/site-packages/discord.py-1.0.1-py3.7.egg/discord/ext/commands/core.py", line 63, in wrapped ret = await coro(*args, **kwargs) File "/home/injabie3/github/Rin/lib/python3.7/site-packages/Red_DiscordBot-3.1.1-py3.7.egg/redbot/cogs/general/general.py", line 327, in urban timeout=30, File "/home/injabie3/github/Rin/lib/python3.7/site-packages/Red_DiscordBot-3.1.1-py3.7.egg/redbot/core/utils/menus.py", line 71, in menu message = await ctx.send(current_page) File "/home/injabie3/github/Rin/lib/python3.7/site-packages/Red_DiscordBot-3.1.1-py3.7.egg/redbot/core/commands/context.py", line 63, in send return await super().send(content=content, **kwargs) File "/home/injabie3/github/Rin/lib/python3.7/site-packages/discord.py-1.0.1-py3.7.egg/discord/abc.py", line 776, in send data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce) File "/home/injabie3/github/Rin/lib/python3.7/site-packages/discord.py-1.0.1-py3.7.egg/discord/http.py", line 222, in request raise HTTPException(r, data) discord.errors.HTTPException: BAD REQUEST (status code: 400): Invalid Form Body In content: Must be 2000 or fewer in length. ``` Perhaps lowering the previous character limit above to something more conservative would be better? #### How can we reproduce this issue? 1. Toggle embed results to off (e.g. `[p]embedset global`) 2. Run the following `[p]urban art student`
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#2683
No description provided.