Skip to content

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

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).

}

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.

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