Ensure filenames are lowercase when uploading with [p]triviaset custom #4594

Merged
KianBral merged 2 commits from custom-upload into V3/develop 2020-11-16 17:42:14 +01:00
KianBral commented 2020-11-11 19:33:58 +01:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Resolves #4570

When a user uses the command [p]triviaset custom upload it now converts the filename to lowercase before saving it.

### Type - [x] Bugfix - [ ] Enhancement - [ ] New feature ### Description of the changes Resolves [#4570](https://github.com/Cog-Creators/Red-DiscordBot/issues/4570) When a user uses the command `[p]triviaset custom upload` it now converts the filename to lowercase before saving it.
Zephyrkul (Migrated from github.com) reviewed 2020-11-11 23:44:09 +01:00
@ -625,7 +625,7 @@ class Trivia(commands.Cog):
-------
Zephyrkul (Migrated from github.com) commented 2020-11-11 23:44:09 +01:00
        filename = attachment.filename.rsplit(".", 1)[0].casefold()

Since Red supports i18n, it might be a better idea to use .casefold() here instead, which supports more characters than .lower() does.

```suggestion filename = attachment.filename.rsplit(".", 1)[0].casefold() ``` Since Red supports i18n, it might be a better idea to use `.casefold()` here instead, which supports more characters than `.lower()` does.
KianBral (Migrated from github.com) reviewed 2020-11-12 01:27:41 +01:00
@ -625,7 +625,7 @@ class Trivia(commands.Cog):
-------
KianBral (Migrated from github.com) commented 2020-11-12 01:27:40 +01:00

Ah makes sense thx.

Ah makes sense thx.
Jackenmen (Migrated from github.com) approved these changes 2020-11-16 17:39:23 +01:00
Jackenmen (Migrated from github.com) left a comment

Looks good to me, thanks for the patch @KianBral

Looks good to me, thanks for the patch @KianBral
Jackenmen commented 2020-11-16 17:49:23 +01:00 (Migrated from github.com)

@KianBral if you're by any chance on our Discord server, let me know what's your Discord username so that I can give you a Contributor role :)

@KianBral if you're by any chance on our Discord server, let me know what's your Discord username so that I can give you a Contributor role :)
KianBral commented 2020-11-16 18:10:53 +01:00 (Migrated from github.com)

@KianBral if you're by any chance on our Discord server, let me know what's your Discord username so that I can give you a Contributor role :)

Yea I'm in the server, username is
@K B
K B#1869

thanks!

> @KianBral if you're by any chance on our Discord server, let me know what's your Discord username so that I can give you a Contributor role :) Yea I'm in the server, username is `@K B` K B#1869 thanks!
Sign in to join this conversation.
No reviewers
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!4594
No description provided.