Skip to content

Commit

Permalink
channel name mechanism (#53)
Browse files Browse the repository at this point in the history
* `channel_name` mechanism

* Change `channel_name` to simply `name` + fixes
  • Loading branch information
BreadcrumbIsTaken committed Mar 12, 2023
1 parent 78abd04 commit 7593409
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -575,5 +575,16 @@ public void adjust(Mechanism mechanism) {
if (mechanism.matches("delete")) {
getChannel().delete().complete();
}

// <--[mechanism]
// @object DiscordChannelTag
// @name name
// @input ElementTag
// @description
// Renames this channel.
// -->
if (mechanism.matches("name") && mechanism.requireObject(ElementTag.class)) {
((GuildChannel) getChannel()).getManager().setName(mechanism.getValue().asString()).submit();
}
}
}

0 comments on commit 7593409

Please sign in to comment.