Skip to content

baseplugin

This file contains the BasePlugin object, which represents a Roblox plugin ID.

BasePlugin

Bases: BaseAsset

Represents a Roblox plugin ID. Plugins are a form of Asset and as such this object derives from BaseAsset.

Attributes:

Name Type Description
id int

The plugin ID.

Source code in roblox/bases/baseplugin.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class BasePlugin(BaseAsset):
    """
    Represents a Roblox plugin ID.
    Plugins are a form of Asset and as such this object derives from BaseAsset.

    Attributes:
        id: The plugin ID.
    """

    def __init__(self, client: Client, plugin_id: int):
        """
        Arguments:
            client: The Client this object belongs to.
            plugin_id: The plugin ID.
        """

        super().__init__(client, plugin_id)

        self._client: Client = client
        self.id: int = plugin_id

    async def update(self, name: str = None, description: str = None, comments_enabled: str = None):
        """
        Updates the plugin's data.

        Arguments:
            name: The new group name.
            description: The new group description.
            comments_enabled: Whether to enable comments.
        """
        await self._client.requests.patch(
            url=self._client.url_generator.get_url(
                "develop", f"v1/plugins/{self.id}"
            ),
            json={
                "name": name,
                "description": description,
                "commentsEnabled": comments_enabled
            }
        )

__init__(client, plugin_id)

Parameters:

Name Type Description Default
client Client

The Client this object belongs to.

required
plugin_id int

The plugin ID.

required
Source code in roblox/bases/baseplugin.py
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, client: Client, plugin_id: int):
    """
    Arguments:
        client: The Client this object belongs to.
        plugin_id: The plugin ID.
    """

    super().__init__(client, plugin_id)

    self._client: Client = client
    self.id: int = plugin_id

update(name=None, description=None, comments_enabled=None) async

Updates the plugin's data.

Parameters:

Name Type Description Default
name str

The new group name.

None
description str

The new group description.

None
comments_enabled str

Whether to enable comments.

None
Source code in roblox/bases/baseplugin.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
async def update(self, name: str = None, description: str = None, comments_enabled: str = None):
    """
    Updates the plugin's data.

    Arguments:
        name: The new group name.
        description: The new group description.
        comments_enabled: Whether to enable comments.
    """
    await self._client.requests.patch(
        url=self._client.url_generator.get_url(
            "develop", f"v1/plugins/{self.id}"
        ),
        json={
            "name": name,
            "description": description,
            "commentsEnabled": comments_enabled
        }
    )