Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I started making a level command :3 #559

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

AmilieCoding
Copy link
Contributor

@AmilieCoding AmilieCoding commented Sep 20, 2024

It's not useful but I hope its a good start :3

Summary by Sourcery

Add a new 'level' command to the Discord bot, enabling users to view their current level and experience points through an embedded message.

New Features:

  • Introduce a new 'level' command in the Discord bot, allowing users to check their level and experience points.

It's not useful but I hope its a good start :3
Copy link
Contributor

sourcery-ai bot commented Sep 20, 2024

Reviewer's Guide by Sourcery

This pull request introduces a new 'level' command as part of a leveling system. The implementation adds a new file 'levels.py' in the 'tux/cogs/fun/' directory, setting up the basic structure for a Levels cog in a Discord bot using the discord.py library.

File-Level Changes

Change Details Files
Implement a new 'level' command in a Levels cog
  • Create a new Levels cog class
  • Implement a hybrid command group named 'level' with an alias 'lvl'
  • Add a placeholder response for the level command
  • Set up the cog to be added to the bot
tux/cogs/fun/levels.py
Set up basic structure for future expansion of the leveling system
  • Import necessary modules and classes
  • Initialize an empty list 'usermessages' for potential future use
  • Create a guild-only command to ensure it's used in server contexts
tux/cogs/fun/levels.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AmilieCoding - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Good start on the level command structure. To make it functional, consider implementing actual level and exp tracking. Also, remove unused imports and variables (like 'client' and 'usermessages').
  • Adding docstrings to the class and methods would improve code readability and help others understand the purpose and usage of this feature.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

client = discord.Client


usermessages = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Remove unused global list 'usermessages'

This list is defined globally but never used in the code. It's best to remove unused variables to keep the code clean and prevent potential issues with global state.

Suggested change
usermessages = []
# Remove the following line:
# usermessages = []

from tux.bot import Tux
from tux.ui.embeds import EmbedCreator

client = discord.Client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Remove unused 'client' variable

This variable is assigning the Discord Client class to a variable, not instantiating it, and it's never used in the code. Consider removing it to improve code clarity.

Suggested change
client = discord.Client
# Remove the unused 'client' variable

Comment on lines +27 to +28
title="You are level level",
description="Your have exp exp!",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Implement actual level and exp calculation logic

The current implementation uses placeholder text for level and exp. Consider implementing the actual logic to calculate and display the user's level and experience points.

            title=f"You are level {user_level}",
            description=f"You have {user_exp} exp!",

@Atmois Atmois merged commit 84dbe0a into allthingslinux:levels Sep 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants