-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Conversation
Why not just use guild.channels.delete(id)? |
(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
I did not know I had but, if receive only the channel is kinda weird to do |
You're right, it's the same endpoint. |
Seems reasonable to me. But should be a part of GuildChannel class, not Channel (which includes DM channels that cannot be deleted). |
src/structures/channel.ts
Outdated
@@ -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) |
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.
Delete needs to be async and you need to await deleteChannel.
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.
oh yeah, forget
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.
LGTM, thanks
About
Just easy way to delete channels
Status