-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: master
Are you sure you want to change the base?
Time #79
Conversation
Please avoid commit messages that fail to describe changes made. You can do |
It seems like your PR includes a binary file that should have been gitignored. Please add |
We ask that all cog filenames end in |
|
||
def setup(bot): | ||
bot.add_cog(TimeConverter(bot)) | ||
å |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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!
Time converter