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

Time #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Time #79

wants to merge 1 commit into from

Conversation

Siris2314
Copy link
Contributor

Time converter

@rosalogia
Copy link
Owner

Please avoid commit messages that fail to describe changes made. You can do git reset HEAD^ to soft undo this commit, then add the changes you've made and commit them again with a descriptive commit message.

@rosalogia
Copy link
Owner

It seems like your PR includes a binary file that should have been gitignored. Please add .DS_Store to your .gitignore file.

@rosalogia
Copy link
Owner

We ask that all cog filenames end in cog.py. This is a matter of functionality; please refer to main.py to see why. We also ask that cog filenames be all lowercase. This is a matter of style/consistency. Thanks!


def setup(bot):
bot.add_cog(TimeConverter(bot))
å
Copy link
Owner

Choose a reason for hiding this comment

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

This line seems like a mistake. Please remove it 🙂

@commands.command
async def convert(cls, argument):
args = argument.lower()
matches = re.findall(time_regex, args)
Copy link
Owner

Choose a reason for hiding this comment

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

Is time_regex defined somewhere?

time = 0
for key, value in matches:
try:
time += time_dict[value] * float(key)
Copy link
Owner

Choose a reason for hiding this comment

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

Where is time_dict defined?

def __init__(self, bot):
self.bot = bot

@commands.command
Copy link
Owner

Choose a reason for hiding this comment

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

I believe this should be @commands.command(). Have you tested this code?

from discord.ext import commands


class TimeConverter(commands.Cog):
Copy link
Owner

Choose a reason for hiding this comment

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

For the sake of consistency, could you change the name of this class to TimeCog and change the file name to correspond to it? Thanks!

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