8000 Channel: Add delete function by jak3z · Pull Request #282 · harmonyland/harmony · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Channel: Add delete function #282

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

Merged
merged 3 commits into from
Jan 4, 2022
Merged

Channel: Add delete function #282

merged 3 commits into from
Jan 4, 2022

Conversation

jak3z
Copy link
Contributor
@jak3z jak3z commented Jan 2, 2022

About

Just easy way to delete channels

Status

  • These changes have been tested against Discord API or do not contain API change.
  • This PR includes only documentation changes, no code change.
  • This PR introduces some Breaking changes.

@invalidCards
Copy link
Contributor

Why not just use guild.channels.delete(id)?

@invalidCards
Copy link
Contributor

(By the way, if anything, this method should be on the GuildChannel class, as it's not possible to delete non-guild channels, such as (group) DMs.)

@jak3z
Copy link
Contributor Author
jak3z commented Jan 2, 2022

(By the way, if anything, this method should be on the GuildChannel class, as it's not possible to delete non-guild channels, such as (group) DMs.)

Technically you have how to close the channel, but i do not know the difference of this for a bot

Why not just use guild.channels.delete(id)?

I did not know I had but, if receive only the channel is kinda weird to do GuildChannel.guild.channels.delete(GuildChannel.id) but it makes sense

@invalidCards
Copy link
Contributor
invalidCards commented Jan 2, 2022 8000

Technically you have how to close the channel, but i do not know the difference of this for a bot

You're right, it's the same endpoint.

@DjDeveloperr
Copy link
Member

Seems reasonable to me. But should be a part of GuildChannel class, not Channel (which includes DM channels that cannot be deleted).

@@ -151,6 +151,11 @@ export class GuildChannel extends Channel {
this.parentID = data.parent_id ?? this.parentID
}

delete(): this {
this.client.rest.endpoints.deleteChannel(this.id)
Copy link
Member

Choose a reason for hiding this comment

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

8000

Delete needs to be async and you need to await deleteChannel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah, forget

Copy link
Member
@DjDeveloperr DjDeveloperr left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@DjDeveloperr DjDeveloperr merged commit ca64ee2 into harmonyland:main Jan 4, 2022
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.

3 participants
0