$rulesChannelID

Returns the servers rule channel’s ID (*returns an error if there isn’t such a channel“)

Syntax

$rulesChannelID[(Guild ID)]

Parameters

  • Guild ID (Type: Snowflake || Flag: Optional): The guild to get the rule channel’s ID.

Example

$nomention
Rule channel's ID: $rulesChannelID[$guildID]
!example Rule channel's ID: 594598851155984426

How to stop the error message?

The $rulesChannelID[] function as said in above returns an error if there isn’t any rule channel set on the server and there is a way to stop that.

$nomention
$try 
  Rule channel's ID: $ruleChannelID[$guildID]
$catch
  No rule channel found!
$endtry
  • Without try block:
!example ❌ Function $rulesChannelID at 2:33 returned an error: No rule channel set in this server!
  • With try block:
!example No rule channel found!

For more information, read the Error Handling guide.