hikari.internal.mentions#

Utility functions used for managing mentions on Discord.

Module Contents#

hikari.internal.mentions.generate_allowed_mentions(mentions_everyone, mentions_reply, user_mentions, role_mentions)[source]#

Generate an allowed mentions JSON object.

Parameters:
mentions_everyonehikari.undefined.UndefinedOr[bool]

Whether @everyone and @here mentions are enabled. If hikari.undefined.UNDEFINED or False then this will be disabled.

mentions_replyhikari.undefined.UndefinedOr[bool]

Whether the reply mention should be enabled. If hikari.undefined.UNDEFINED or False then this will be disabled.

user_mentionshikari.undefined.UndefinedOr[typing.Union[hikari.snowflakes.SnowflakeishSequence[hikari.users.PartialUser], bool]]

Either a sequence of objects/IDs of the users to enabled mentions for, True to allow all mentions or False/hikari.undefined.UNDEFINED to disable all user mentions.

role_mentionshikari.undefined.UndefinedOr[typing.Union[hikari.snowflakes.SnowflakeishSequence[hikari.guilds.PartialRole], bool]]

Either a sequence of objects/IDs of the roles to enabled mentions for, True to allow all mentions or False/hikari.undefined.UNDEFINED to disable all user mentions.

Returns:
hikari.internal.data_binding.JSONObject

The allowed mentions JSON Object.