About Specifications and Issues #36

Closed
opened 2021-08-30 10:03:36 +00:00 by AomiVel · 4 comments
AomiVel commented 2021-08-30 10:03:36 +00:00 (Migrated from github.com)

about Specifications

Why is there a mix of specifications up to 1.7 and use of 2.0?

Example:

  • 1.7's avatar_url
  • 2.0's datetime type (aware/native)

about Issues

We can't make an issue unless we use a special method.

Can not:
1, Go to Issues tab
2, Click "New issue" button

Can:
Access the link to create an new issue.
(https://github.com/iDevision/enhanced-discord.py/issues/new)

# about Specifications Why is there a mix of specifications up to 1.7 and use of 2.0? Example: - 1.7's avatar_url - 2.0's datetime type (aware/native) # about Issues We can't make an issue unless we use a special method. Can not: 1, Go to Issues tab 2, Click "New issue" button Can: Access the link to create an new issue. (https://github.com/iDevision/enhanced-discord.py/issues/new)
paris-ci commented 2021-08-30 19:54:53 +00:00 (Migrated from github.com)

Why is there a mix of specifications up to 1.7 and use of 2.0?

They are branches. 2.0 is the only maintained branch.

We can't make an issue unless we use a special method.

That's a github/browser bug. I am able to create issues just fine.

> Why is there a mix of specifications up to 1.7 and use of 2.0? They are branches. 2.0 is the only maintained branch. > We can't make an issue unless we use a special method. That's a github/browser bug. I am able to create issues just fine.
AomiVel commented 2021-08-30 23:49:40 +00:00 (Migrated from github.com)

They are branches. 2.0 is the only maintained branch.

The 1.7 and 2.0 mentioned here are from Discord.py. My apologies.

What I want to ask is why there is a mix of User.avatar_url, which is the spec up to 1.7 of discord.py, and datatime type aware, which is the spec from 2.0 of discord.py.
If this is the case, people who want to migrate from discord.py may have to rewrite the code.
What do you think about this?

That's a github/browser bug. I am able to create issues just fine.

I think it's not github's bug.

I think you can recreate it this way:

  1. open issue tab. (this repository)
  2. Click "New issue" button.
  3. You will see two options, "Ask a question" and "Discord Server".

Selecting "Ask a question" will take you to the Discussions tab of the original Discord.py.
Selecting "Discord Server" will take you to the original Discord.py's official server invite link.

I don't know if this is correct because I don't know much about Github, but I think it has something to do with the files in this folder(https://github.com/iDevision/enhanced-discord.py/tree/master/.github/ISSUE_TEMPLATE).

(I'm not a native speaker, so I use the DeepL translator. Sorry.)

> They are branches. 2.0 is the only maintained branch. The 1.7 and 2.0 mentioned here are from Discord.py. My apologies. What I want to ask is why there is a mix of User.avatar_url, which is the spec up to 1.7 of discord.py, and datatime type aware, which is the spec from 2.0 of discord.py. If this is the case, people who want to migrate from discord.py may have to rewrite the code. What do you think about this? > That's a github/browser bug. I am able to create issues just fine. I think it's not github's bug. I think you can recreate it this way: 1. open issue tab. (this repository) 2. Click "New issue" button. 3. You will see two options, "Ask a question" and "Discord Server". Selecting "Ask a question" will take you to the Discussions tab of the original Discord.py. Selecting "Discord Server" will take you to the original Discord.py's official server invite link. I don't know if this is correct because I don't know much about Github, but I think it has something to do with the files in this folder(https://github.com/iDevision/enhanced-discord.py/tree/master/.github/ISSUE_TEMPLATE). (I'm not a native speaker, so I use the DeepL translator. Sorry.)
paris-ci commented 2021-08-31 10:23:32 +00:00 (Migrated from github.com)

The 1.7 and 2.0 mentioned here are from Discord.py. My apologies.

What I want to ask is why there is a mix of User.avatar_url, which is the spec up to 1.7 of discord.py, and datatime type aware, which is the spec from 2.0 of discord.py.
If this is the case, people who want to migrate from discord.py may have to rewrite the code.
What do you think about this?

Where exactly do you see the mix ? In the online docs ? Because the 2.0 branch is a direct upgrade from dpy2.0a with a few added features.

I think it's not github's bug.

Oh yeah, I saw what you meant, I'll fix it

> The 1.7 and 2.0 mentioned here are from Discord.py. My apologies. > > What I want to ask is why there is a mix of User.avatar_url, which is the spec up to 1.7 of discord.py, and datatime type aware, which is the spec from 2.0 of discord.py. > If this is the case, people who want to migrate from discord.py may have to rewrite the code. What do you think about this? Where exactly do you see the mix ? In the online docs ? Because the 2.0 branch is a direct upgrade from dpy2.0a with a few added features. > I think it's not github's bug. Oh yeah, I saw what you meant, I'll fix it
AomiVel commented 2021-08-31 11:32:22 +00:00 (Migrated from github.com)

Oh yeah, I saw what you meant, I'll fix it

Thank you.

Where exactly do you see the mix ?

I'm sorry, I forgot to tell you. It's in the program.

You will be able to reproduce this way:

import discord # enhanced-discord.py
import datetime
import traceback

client = discord.Client()

@client.event
async def on_ready():
    message = await client.get_channel(<channel_id>).fetch_message(<message_id>)
    
    try:
        message.created_at < datetime.datetime.utcnow()
    except Exception as e:
        """ If the datetime offset is different, an error will be print """
        # Error: TypeError: can't compare offset-naive and offset-aware datetimes
        traceback.print_exc(e)

    message.author.avatar_url
    message.author.avatar.url # Error

client.run(<TOKEN>)

In 2.0, the datetime offset returned by created_at, etc. is now aware. However, the offset returned by datetime.utcnow is naive. These comparisons will raise a TypeError.

In 1.7, if you want to get the avatar url of a user, use User.avatar_url. However, in 2.0, User.avatar.url is used.

Is there a reason for these?

> Oh yeah, I saw what you meant, I'll fix it Thank you. > Where exactly do you see the mix ? I'm sorry, I forgot to tell you. It's in the program. You will be able to reproduce this way: ```py import discord # enhanced-discord.py import datetime import traceback client = discord.Client() @client.event async def on_ready(): message = await client.get_channel(<channel_id>).fetch_message(<message_id>) try: message.created_at < datetime.datetime.utcnow() except Exception as e: """ If the datetime offset is different, an error will be print """ # Error: TypeError: can't compare offset-naive and offset-aware datetimes traceback.print_exc(e) message.author.avatar_url message.author.avatar.url # Error client.run(<TOKEN>) ``` In 2.0, the datetime offset returned by `created_at`, etc. is now `aware`. However, the offset returned by `datetime.utcnow` is `naive`. These comparisons will raise a TypeError. In 1.7, if you want to get the avatar url of a user, use `User.avatar_url`. However, in 2.0, `User.avatar.url` is used. Is there a reason for these?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: matthew/enhanced-discord.py#36
No description provided.