Loco-CTO / Rystal-V6-Experiments

Attribute defined outside __init__ PYL-W0201
Anti-pattern
Minor
20 days ago2 months old
Attribute 'lang' defined outside __init__
114            user_points: The total points of the user.
115            view (nextcord.ui.View, optional): The view to attach to the message.
116        """
117        self.lang = await self.get_lang()118        embed = nextcord.Embed(title=title, description=description, color=color)
119        embed.add_field(
120            name=self.lang["blackjack_your_hand"],
Attribute 'lang' defined outside __init__
246    async def on_timeout(self):
247        """Handle the timeout event for the view."""
248        if not self.ended:
249            self.lang = await self.get_lang()250            await self.handle_bet_result(
251                self.interaction, BlackjackResult.DEALER_WINS, send=False
252            )
Attribute 'lang' defined outside __init__
220
221    @nextcord.ui.button(label="Stand", style=nextcord.ButtonStyle.secondary)
222    async def stand_button(self, button, interaction):
223        self.lang = await self.get_lang()224        if interaction.user.id == self.author_id:
225            """
226            Handle the "Stand" button interaction.
Attribute 'lang' defined outside __init__
189            button (nextcord.ui.Button): The button that was clicked.
190            interaction (nextcord.Interaction): The interaction that triggered the button click.
191        """
192        self.lang = await self.get_lang()193        user_id = self.interaction.user.id
194        user_points = (await user_handler.get_user_data(user_id))["points"]
195        if interaction.user.id == self.author_id:
Attribute 'interaction' defined outside __init__
164        """
165        self.author = interaction.user
166        self.channel = interaction.channel
167        self.interaction = interaction168        dropdown = DropdownSelector(
169            options=self.options,
170            placeholder=self.placeholder,