Discord-btns-menus

Latest version: v0.2.6

Safety actively analyzes 623586 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.2.6

0.2.4

Useful Features Added ! [![Generic badge](https://img.shields.io/badge/NEW-gold.svg)](https://shields.io/)
For both **SButton** and **SDropMenu**

Methods Added:
- is_owner(...)
- has_roles(self, *roles: Union[int, str], error_msg = None)
- has_any_role(self, *roles: Union[int, str], error_msg = None)
- has_permissions(self, *, error_msg = None, **perms: bool)
- is_author(self, /, error_msg = None)
- is_any_user(self, *users: Union[str, int], error_msg = None)
- Changed **verify_** parem to **verify** in both **SButton** and **SDropMenu**
- Two types of **Paginator** added, can be accessed using **class: `Pgtypes`**
<hr/>

Example for SButton:
python
client.command()
async def test(ctx):
btn = SButton(label="Here", response="Hello", ephemeral=True)
view_ = SingleButton(ctx.author, btn).view()
btn.has_roles(811462625539522574, 811820286806720532, error_msg="You don't have the required role !")
await ctx.send("Testing ...", view=view_)


<hr>

Example for SDropMenu:
python
client.command()
async def test(ctx):
menu = SDropMenu(placeholder="Here", response="Hello", ephemeral=True, options=[
SelectOption(label="hello")
])
view_ = SingleDropMenu(ctx.author, menu).view()
menu.has_any_role(811462625539522574, 811820286806720532, error_msg="You don't have the required role !")
await ctx.send("Testing ...", view=view_)


<hr/>

For more guidelines join our [Official Discord Server](https://discord.gg/GVMWx5EaAN)

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.