Skip to content

Tags

genjishimada_sdk.tags

OpAlias

Bases: OpBase

Create an alias for an existing tag.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

new_name str

Alias name to create.

old_name str

Existing tag to alias.

owner_id int

Identifier of the user creating the alias.

guild_id: int instance-attribute

new_name: str instance-attribute

old_name: str instance-attribute

owner_id: int instance-attribute

OpBase

Bases: Struct

Discriminated union base; JSON will include an 'op' field with the tag.

op: str property

Return the operation type.

OpClaim

Bases: OpBase

Claim ownership of an existing tag.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

name str

Name of the tag to claim.

requester_id int

Identifier of the user requesting ownership.

guild_id: int instance-attribute

name: str instance-attribute

requester_id: int instance-attribute

OpCreate

Bases: OpBase

Create a new tag.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

name str

Name of the tag to create.

content str

Content body of the tag.

owner_id int

Identifier of the user creating the tag.

content: str instance-attribute

guild_id: int instance-attribute

name: str instance-attribute

owner_id: int instance-attribute

OpEdit

Bases: OpBase

Update the content of an existing tag.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

name str

Name of the tag to edit.

new_content str

Replacement content for the tag.

owner_id int

Identifier of the user editing the tag.

guild_id: int instance-attribute

name: str instance-attribute

new_content: str instance-attribute

owner_id: int instance-attribute

OpIncrementUsage

Bases: OpBase

Increment the usage count for a tag.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

name str

Name of the tag to increment.

guild_id: int instance-attribute

name: str instance-attribute

OpPurge

Bases: OpBase

Bulk-remove all tags belonging to an owner.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag collection.

owner_id int

Identifier of the owner whose tags are purged.

requester_id int

Identifier of the user requesting the purge.

guild_id: int instance-attribute

owner_id: int instance-attribute

requester_id: int instance-attribute

OpRemove

Bases: OpBase

Delete a tag by name.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

name str

Name of the tag to remove.

requester_id int

Identifier of the user requesting removal.

guild_id: int instance-attribute

name: str instance-attribute

requester_id: int instance-attribute

OpRemoveById

Bases: OpBase

Delete a tag by its identifier.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

tag_id int

Identifier of the tag to remove.

requester_id int

Identifier of the user requesting removal.

guild_id: int instance-attribute

requester_id: int instance-attribute

tag_id: int instance-attribute

OpTransfer

Bases: OpBase

Transfer tag ownership to another user.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tag.

name str

Name of the tag to transfer.

new_owner_id int

Identifier of the user receiving ownership.

requester_id int

Identifier of the user requesting the transfer.

guild_id: int instance-attribute

name: str instance-attribute

new_owner_id: int instance-attribute

requester_id: int instance-attribute

TagOp = OpCreate | OpAlias | OpEdit | OpRemove | OpRemoveById | OpClaim | OpTransfer | OpPurge | OpIncrementUsage module-attribute

TagRowDTO

Bases: Struct

Represents a tag row with optional metadata.

Attributes:

Name Type Description
id int

Unique tag identifier.

guild_id int

Discord guild that owns the tag.

name str

Tag name.

owner_id int

Identifier of the tag owner.

is_alias bool

Whether the tag is an alias.

canonical_name str | None

Canonical tag name when this row is an alias.

uses int | None

Number of times the tag has been used.

content str | None

Tag content payload.

rank int | None

Optional ranking position for search results.

canonical_name: str | None = None class-attribute instance-attribute

content: str | None = None class-attribute instance-attribute

guild_id: int instance-attribute

id: int instance-attribute

is_alias: bool = False class-attribute instance-attribute

name: str instance-attribute

owner_id: int instance-attribute

rank: int | None = None class-attribute instance-attribute

uses: int | None = None class-attribute instance-attribute

TagsAutocompleteRequest

Bases: Struct

Request payload for tag autocomplete queries.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tags.

q str

User-entered query string.

mode Literal['aliased', 'non_aliased', 'owned_aliased', 'owned_non_aliased']

Autocomplete mode controlling alias inclusion.

owner_id int | None

Filter results by owner.

limit int

Maximum number of suggestions to return.

guild_id: int instance-attribute

limit: int = 12 class-attribute instance-attribute

mode: Literal['aliased', 'non_aliased', 'owned_aliased', 'owned_non_aliased'] = 'aliased' class-attribute instance-attribute

owner_id: int | None = None class-attribute instance-attribute

q: str instance-attribute

TagsAutocompleteResponse

Bases: Struct

Autocomplete suggestions for a tag query.

Attributes:

Name Type Description
items list[str]

Ordered list of suggested tag names.

items: list[str] instance-attribute

TagsMutateRequest

Bases: Struct

Batch request to mutate tags.

Attributes:

Name Type Description
ops list[TagOp]

Ordered list of tag operations to perform.

ops: list[TagOp] instance-attribute

TagsMutateResponse

Bases: Struct

Response containing results for each mutation operation.

Attributes:

Name Type Description
results list[TagsMutateResult]

Ordered list of operation results.

results: list[TagsMutateResult] instance-attribute

TagsMutateResult

Bases: Struct

Result of a single tag mutation operation.

Attributes:

Name Type Description
ok bool

Whether the operation succeeded.

message str | None

Optional human-readable message.

affected int | None

Number of rows affected by the operation.

tag_id int | None

Identifier of the tag affected, if applicable.

affected: int | None = None class-attribute instance-attribute

message: str | None = None class-attribute instance-attribute

ok: bool instance-attribute

tag_id: int | None = None class-attribute instance-attribute

TagsSearchFilters

Bases: Struct

Search filters for tag queries.

Attributes:

Name Type Description
guild_id int

Discord guild identifier that owns the tags.

name str | None

Raw tag name to search for.

fuzzy bool

Whether to enable fuzzy matching.

include_aliases bool

Whether to include aliases in results.

only_aliases bool

Whether to return only alias rows.

owner_id int | None

Filter by tag owner.

random bool

Whether to return a random tag.

by_id int | None

Lookup a specific tag by ID.

include_content bool

Include content body in results.

include_rank bool

Include ranking information in results.

sort_by Literal['name', 'uses', 'created_at']

Sorting column for the result set.

sort_dir Literal['asc', 'desc']

Sorting direction for results.

limit int

Maximum number of rows to return.

offset int

Number of rows to skip for pagination.

by_id: int | None = None class-attribute instance-attribute

fuzzy: bool = False class-attribute instance-attribute

guild_id: int instance-attribute

include_aliases: bool = True class-attribute instance-attribute

include_content: bool = False class-attribute instance-attribute

include_rank: bool = False class-attribute instance-attribute

limit: int = 20 class-attribute instance-attribute

name: str | None = None class-attribute instance-attribute

offset: int = 0 class-attribute instance-attribute

only_aliases: bool = False class-attribute instance-attribute

owner_id: int | None = None class-attribute instance-attribute

random: bool = False class-attribute instance-attribute

sort_by: Literal['name', 'uses', 'created_at'] = 'name' class-attribute instance-attribute

sort_dir: Literal['asc', 'desc'] = 'asc' class-attribute instance-attribute

TagsSearchResponse

Bases: Struct

Response for tag search queries.

Attributes:

Name Type Description
items list[TagRowDTO]

Matching tags.

total int | None

Optional total for pagination.

suggestions list[str] | None

Optional fallback suggestions for fuzzy matches.

items: list[TagRowDTO] instance-attribute

suggestions: list[str] | None = None class-attribute instance-attribute

total: int | None = None class-attribute instance-attribute

__all__ = ('OpAlias', 'OpBase', 'OpClaim', 'OpCreate', 'OpEdit', 'OpIncrementUsage', 'OpPurge', 'OpRemove', 'OpRemoveById', 'OpTransfer', 'TagOp', 'TagRowDTO', 'TagsAutocompleteRequest', 'TagsAutocompleteResponse', 'TagsMutateRequest', 'TagsMutateResponse', 'TagsMutateResult', 'TagsSearchFilters', 'TagsSearchResponse') module-attribute