Reformat entire project with ruff instead of black

This commit is contained in:
Rapptz
2025-08-18 20:15:44 -04:00
parent 3ef6272e07
commit 44a44e938f
88 changed files with 485 additions and 730 deletions

View File

@ -22,7 +22,6 @@ class CounterBot(commands.Bot):
# Define a simple View that gives us a counter button
class Counter(discord.ui.View):
# Define the actual button
# When pressed, this increments the number displayed until it hits 5.
# When it hits 5, the counter button is disabled and it turns green.

View File

@ -3,12 +3,12 @@
import discord
from discord.ext import commands
# Defines a custom Select containing colour options
# that the user can choose. The callback function
# of this class is called when the user changes their choice
class Dropdown(discord.ui.Select):
def __init__(self):
# Set the options that will be presented inside the dropdown
options = [
discord.SelectOption(label='Red', description='Your favourite colour is red', emoji='🟥'),

View File

@ -15,6 +15,7 @@ import re
# `counter:5:user:80088516616269824` where the first number is the current count and the
# second number is the user ID who owns the button.
# Note that custom_ids can only be up to 100 characters long.
class DynamicCounter(
discord.ui.DynamicItem[discord.ui.Button],

View File

@ -22,7 +22,6 @@ class EphemeralCounterBot(commands.Bot):
# Define a simple View that gives us a counter button
class Counter(discord.ui.View):
# Define the actual button
# When pressed, this increments the number displayed until it hits 5.
# When it hits 5, the counter button is disabled and it turns green.

View File

@ -9,24 +9,24 @@ import enum
class FruitType(enum.Enum):
apple = "Apple"
banana = "Banana"
orange = "Orange"
grape = "Grape"
mango = "Mango"
watermelon = "Watermelon"
coconut = "Coconut"
apple = 'Apple'
banana = 'Banana'
orange = 'Orange'
grape = 'Grape'
mango = 'Mango'
watermelon = 'Watermelon'
coconut = 'Coconut'
@property
def emoji(self) -> str:
emojis = {
"Apple": "🍎",
"Banana": "🍌",
"Orange": "🍊",
"Grape": "🍇",
"Mango": "🥭",
"Watermelon": "🍉",
"Coconut": "🥥",
'Apple': '🍎',
'Banana': '🍌',
'Orange': '🍊',
'Grape': '🍇',
'Mango': '🥭',
'Watermelon': '🍉',
'Coconut': '🥥',
}
return emojis[self.value]

View File

@ -4,6 +4,7 @@ from typing import List
from discord.ext import commands
import discord
# Defines a custom button that contains the logic of the game.
# The ['TicTacToe'] bit is for type hinting purposes to tell your IDE or linter
# what the type of `self.view` is. It is not required.