summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 07:32:12 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 07:32:12 +0000
commit4b8d233605ba155be3f8665b8a21564a039fa554 (patch)
treefee681b0d6d457a15c6deeb2b6cbf44340b5a3e4
parentb1608e22e704c10340007d3772444cb5cf2eac5f (diff)
automatic import of python-dslash
-rw-r--r--.gitignore1
-rw-r--r--python-dslash.spec590
-rw-r--r--sources1
3 files changed, 592 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..34ec712 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/dslash-0.6.3.tar.gz
diff --git a/python-dslash.spec b/python-dslash.spec
new file mode 100644
index 0000000..e045226
--- /dev/null
+++ b/python-dslash.spec
@@ -0,0 +1,590 @@
+%global _empty_manifest_terminate_build 0
+Name: python-dslash
+Version: 0.6.3
+Release: 1
+Summary: A library which supplements Nextcord by adding support for slash commands.
+License: MIT
+URL: https://github.com/artemis21/dslash
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/7a/84/998766ed1d522f28f1ea20e703d20db6ade7def53e73ed9df8a6b4fe0a3b/dslash-0.6.3.tar.gz
+BuildArch: noarch
+
+Requires: python3-docstring-parser
+Requires: python3-nextcord
+
+%description
+# DSlash
+
+![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-red?style=flat-square)
+[![Code Style: black](https://img.shields.io/badge/Code%20Style-black-black?style=flat-square)](https://github.com/psf/black)
+[![License: MIT](https://img.shields.io/badge/License-MIT-orange?style=flat-square)](./LICENSE)
+[![PyPI: dslash](https://img.shields.io/badge/PyPI-dslash-green?style=flat-square)](https://pypi.org/project/dslash)
+![Python: ^3.9](https://img.shields.io/badge/python-%5E3.9-blue?style=flat-square)
+
+> **THIS PROJECT IS NO LONGER MAINTAINED**
+>
+> Danny has returned from a break, and [Discord.py](https://github.com/rapptz/discord.py)
+> is now being maintained again, with support for slash commands. Nextcord also
+> now has built-in support for slash commands. For new projects, you should use
+> one of these options (or another).
+>
+> Dslash will continue to receive minimal updates to keep it working, at least
+> for the near future, but it will not receive support for new features.
+>
+> One change Discord has made since this library stopped being maintained was
+> to remove support for bots configuring permissions for their own commands. In
+> order to avoid breaking bots, Dslash still allows permissions to be
+> configured as before, but will now ignore them. The `allow_roles`,
+> `allow_users`, `disallow_roles`, `disallow_users`, `global_permissions` and
+> `guild_permissions` wrappers, as well as the `default_permission` and
+> `permissions` parameters are all deprecated and should not be used.
+
+A library which supplements [Nextcord](https://github.com/nextcord/nextcord)
+(a fork of Discord.py) by adding support for slash commands.
+
+Documentation is still a work in progress, and the library should currently be
+considered unstable.
+
+You can install it using pip, eg. `pip install dslash`.
+
+## Example
+
+```python
+import logging
+import random
+import typing
+
+from dslash import Choices, CommandClient, CommandGroup, CommandSubGroup, subcommand
+from nextcord import Embed, Interaction, Member, Role, Attachment
+
+GUILD_ID = ...
+TOKEN = ...
+
+logging.basicConfig(level=logging.INFO)
+client = CommandClient(guild_id=GUILD_ID)
+
+
+@client.event
+async def on_ready():
+ print(f"Logged in as {client.user}.")
+
+
+@client.command()
+async def roll(interaction: Interaction, sides: typing.Optional[int]):
+ """Roll a dice.
+
+ :param sides: How many sides (default 6).
+ """
+ value = random.randint(1, sides or 6)
+ await interaction.response.send_message(f"You got: {value}")
+
+
+@client.group
+class Images(CommandGroup):
+ """Cute image commands."""
+
+ @subcommand()
+ async def cat(self, interaction: Interaction):
+ """Get a cat image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://cataas.com/cat")
+ )
+
+ @subcommand()
+ async def dog(self, interaction: Interaction):
+ """Get a dog image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://placedog.net/500?random")
+ )
+
+ @subcommand(name="any")
+ async def any_(self, interaction: Interaction):
+ """Get any random image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://picsum.photos/600")
+ )
+
+ @subcommand()
+ async def upload(self, interaction: Interaction, image: Attachment):
+ """Upload a new cute image."""
+ print(f"Uploading {image.proxy_url!r}...")
+ await interaction.response.send_message("All done!")
+
+
+@client.group
+class Admin(CommandGroup):
+ """Admin-only commands."""
+
+ class Roles(CommandSubGroup):
+ """Commands to manage roles."""
+
+ @subcommand(name="del")
+ async def del_(self, interaction: Interaction, role: Role):
+ """Delete a role.
+
+ :param role: The role to delete.
+ """
+ await role.delete()
+ await interaction.response.send_message("Deleted the role.", ephemeral=True)
+
+
+@client.command()
+async def ban(interaction: Interaction, user: Member):
+ """Ban a user.
+
+ :param user: The user to ban.
+ """
+ await user.ban()
+ await interaction.response.send_message("Banned the user.", ephemeral=True)
+
+
+class RPSChoices(Choices):
+ rock = "Rock"
+ paper = "Paper"
+ scissors = "Scissors"
+ gun = "Gun"
+
+
+@client.command()
+async def rps(interaction: Interaction, choice: RPSChoices):
+ """Play rock, paper, scissors.
+
+ :param choice: Your choice.
+ """
+ if choice == RPSChoices.gun:
+ await interaction.response.send_message("That's cheating!")
+ else:
+ await interaction.response.send_message(f"You picked {choice.name}.")
+
+
+client.run(TOKEN)
+```
+
+## Development
+
+As well as Python 3.9+, this project requires Poetry for development.
+[Click this link for installation instructions](https://python-poetry.org/docs/master/#installation),
+or:
+
+- #### \*nix (Linux/MacOS)
+
+ `curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -`
+
+- #### Windows Powershell
+
+ `(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -`
+
+Once you have Poetry installed:
+
+1. **Create a virtual environment:** `poetry shell`
+2. **Install dependencies:** `poetry install`
+
+The following commands are then available:
+
+- `poe format` - Run auto-formatting and linting.
+
+Prefix these with `poetry run` if outside of the Poetry shell.
+
+
+
+%package -n python3-dslash
+Summary: A library which supplements Nextcord by adding support for slash commands.
+Provides: python-dslash
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-dslash
+# DSlash
+
+![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-red?style=flat-square)
+[![Code Style: black](https://img.shields.io/badge/Code%20Style-black-black?style=flat-square)](https://github.com/psf/black)
+[![License: MIT](https://img.shields.io/badge/License-MIT-orange?style=flat-square)](./LICENSE)
+[![PyPI: dslash](https://img.shields.io/badge/PyPI-dslash-green?style=flat-square)](https://pypi.org/project/dslash)
+![Python: ^3.9](https://img.shields.io/badge/python-%5E3.9-blue?style=flat-square)
+
+> **THIS PROJECT IS NO LONGER MAINTAINED**
+>
+> Danny has returned from a break, and [Discord.py](https://github.com/rapptz/discord.py)
+> is now being maintained again, with support for slash commands. Nextcord also
+> now has built-in support for slash commands. For new projects, you should use
+> one of these options (or another).
+>
+> Dslash will continue to receive minimal updates to keep it working, at least
+> for the near future, but it will not receive support for new features.
+>
+> One change Discord has made since this library stopped being maintained was
+> to remove support for bots configuring permissions for their own commands. In
+> order to avoid breaking bots, Dslash still allows permissions to be
+> configured as before, but will now ignore them. The `allow_roles`,
+> `allow_users`, `disallow_roles`, `disallow_users`, `global_permissions` and
+> `guild_permissions` wrappers, as well as the `default_permission` and
+> `permissions` parameters are all deprecated and should not be used.
+
+A library which supplements [Nextcord](https://github.com/nextcord/nextcord)
+(a fork of Discord.py) by adding support for slash commands.
+
+Documentation is still a work in progress, and the library should currently be
+considered unstable.
+
+You can install it using pip, eg. `pip install dslash`.
+
+## Example
+
+```python
+import logging
+import random
+import typing
+
+from dslash import Choices, CommandClient, CommandGroup, CommandSubGroup, subcommand
+from nextcord import Embed, Interaction, Member, Role, Attachment
+
+GUILD_ID = ...
+TOKEN = ...
+
+logging.basicConfig(level=logging.INFO)
+client = CommandClient(guild_id=GUILD_ID)
+
+
+@client.event
+async def on_ready():
+ print(f"Logged in as {client.user}.")
+
+
+@client.command()
+async def roll(interaction: Interaction, sides: typing.Optional[int]):
+ """Roll a dice.
+
+ :param sides: How many sides (default 6).
+ """
+ value = random.randint(1, sides or 6)
+ await interaction.response.send_message(f"You got: {value}")
+
+
+@client.group
+class Images(CommandGroup):
+ """Cute image commands."""
+
+ @subcommand()
+ async def cat(self, interaction: Interaction):
+ """Get a cat image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://cataas.com/cat")
+ )
+
+ @subcommand()
+ async def dog(self, interaction: Interaction):
+ """Get a dog image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://placedog.net/500?random")
+ )
+
+ @subcommand(name="any")
+ async def any_(self, interaction: Interaction):
+ """Get any random image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://picsum.photos/600")
+ )
+
+ @subcommand()
+ async def upload(self, interaction: Interaction, image: Attachment):
+ """Upload a new cute image."""
+ print(f"Uploading {image.proxy_url!r}...")
+ await interaction.response.send_message("All done!")
+
+
+@client.group
+class Admin(CommandGroup):
+ """Admin-only commands."""
+
+ class Roles(CommandSubGroup):
+ """Commands to manage roles."""
+
+ @subcommand(name="del")
+ async def del_(self, interaction: Interaction, role: Role):
+ """Delete a role.
+
+ :param role: The role to delete.
+ """
+ await role.delete()
+ await interaction.response.send_message("Deleted the role.", ephemeral=True)
+
+
+@client.command()
+async def ban(interaction: Interaction, user: Member):
+ """Ban a user.
+
+ :param user: The user to ban.
+ """
+ await user.ban()
+ await interaction.response.send_message("Banned the user.", ephemeral=True)
+
+
+class RPSChoices(Choices):
+ rock = "Rock"
+ paper = "Paper"
+ scissors = "Scissors"
+ gun = "Gun"
+
+
+@client.command()
+async def rps(interaction: Interaction, choice: RPSChoices):
+ """Play rock, paper, scissors.
+
+ :param choice: Your choice.
+ """
+ if choice == RPSChoices.gun:
+ await interaction.response.send_message("That's cheating!")
+ else:
+ await interaction.response.send_message(f"You picked {choice.name}.")
+
+
+client.run(TOKEN)
+```
+
+## Development
+
+As well as Python 3.9+, this project requires Poetry for development.
+[Click this link for installation instructions](https://python-poetry.org/docs/master/#installation),
+or:
+
+- #### \*nix (Linux/MacOS)
+
+ `curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -`
+
+- #### Windows Powershell
+
+ `(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -`
+
+Once you have Poetry installed:
+
+1. **Create a virtual environment:** `poetry shell`
+2. **Install dependencies:** `poetry install`
+
+The following commands are then available:
+
+- `poe format` - Run auto-formatting and linting.
+
+Prefix these with `poetry run` if outside of the Poetry shell.
+
+
+
+%package help
+Summary: Development documents and examples for dslash
+Provides: python3-dslash-doc
+%description help
+# DSlash
+
+![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-red?style=flat-square)
+[![Code Style: black](https://img.shields.io/badge/Code%20Style-black-black?style=flat-square)](https://github.com/psf/black)
+[![License: MIT](https://img.shields.io/badge/License-MIT-orange?style=flat-square)](./LICENSE)
+[![PyPI: dslash](https://img.shields.io/badge/PyPI-dslash-green?style=flat-square)](https://pypi.org/project/dslash)
+![Python: ^3.9](https://img.shields.io/badge/python-%5E3.9-blue?style=flat-square)
+
+> **THIS PROJECT IS NO LONGER MAINTAINED**
+>
+> Danny has returned from a break, and [Discord.py](https://github.com/rapptz/discord.py)
+> is now being maintained again, with support for slash commands. Nextcord also
+> now has built-in support for slash commands. For new projects, you should use
+> one of these options (or another).
+>
+> Dslash will continue to receive minimal updates to keep it working, at least
+> for the near future, but it will not receive support for new features.
+>
+> One change Discord has made since this library stopped being maintained was
+> to remove support for bots configuring permissions for their own commands. In
+> order to avoid breaking bots, Dslash still allows permissions to be
+> configured as before, but will now ignore them. The `allow_roles`,
+> `allow_users`, `disallow_roles`, `disallow_users`, `global_permissions` and
+> `guild_permissions` wrappers, as well as the `default_permission` and
+> `permissions` parameters are all deprecated and should not be used.
+
+A library which supplements [Nextcord](https://github.com/nextcord/nextcord)
+(a fork of Discord.py) by adding support for slash commands.
+
+Documentation is still a work in progress, and the library should currently be
+considered unstable.
+
+You can install it using pip, eg. `pip install dslash`.
+
+## Example
+
+```python
+import logging
+import random
+import typing
+
+from dslash import Choices, CommandClient, CommandGroup, CommandSubGroup, subcommand
+from nextcord import Embed, Interaction, Member, Role, Attachment
+
+GUILD_ID = ...
+TOKEN = ...
+
+logging.basicConfig(level=logging.INFO)
+client = CommandClient(guild_id=GUILD_ID)
+
+
+@client.event
+async def on_ready():
+ print(f"Logged in as {client.user}.")
+
+
+@client.command()
+async def roll(interaction: Interaction, sides: typing.Optional[int]):
+ """Roll a dice.
+
+ :param sides: How many sides (default 6).
+ """
+ value = random.randint(1, sides or 6)
+ await interaction.response.send_message(f"You got: {value}")
+
+
+@client.group
+class Images(CommandGroup):
+ """Cute image commands."""
+
+ @subcommand()
+ async def cat(self, interaction: Interaction):
+ """Get a cat image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://cataas.com/cat")
+ )
+
+ @subcommand()
+ async def dog(self, interaction: Interaction):
+ """Get a dog image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://placedog.net/500?random")
+ )
+
+ @subcommand(name="any")
+ async def any_(self, interaction: Interaction):
+ """Get any random image."""
+ await interaction.response.send_message(
+ embed=Embed().set_image(url="https://picsum.photos/600")
+ )
+
+ @subcommand()
+ async def upload(self, interaction: Interaction, image: Attachment):
+ """Upload a new cute image."""
+ print(f"Uploading {image.proxy_url!r}...")
+ await interaction.response.send_message("All done!")
+
+
+@client.group
+class Admin(CommandGroup):
+ """Admin-only commands."""
+
+ class Roles(CommandSubGroup):
+ """Commands to manage roles."""
+
+ @subcommand(name="del")
+ async def del_(self, interaction: Interaction, role: Role):
+ """Delete a role.
+
+ :param role: The role to delete.
+ """
+ await role.delete()
+ await interaction.response.send_message("Deleted the role.", ephemeral=True)
+
+
+@client.command()
+async def ban(interaction: Interaction, user: Member):
+ """Ban a user.
+
+ :param user: The user to ban.
+ """
+ await user.ban()
+ await interaction.response.send_message("Banned the user.", ephemeral=True)
+
+
+class RPSChoices(Choices):
+ rock = "Rock"
+ paper = "Paper"
+ scissors = "Scissors"
+ gun = "Gun"
+
+
+@client.command()
+async def rps(interaction: Interaction, choice: RPSChoices):
+ """Play rock, paper, scissors.
+
+ :param choice: Your choice.
+ """
+ if choice == RPSChoices.gun:
+ await interaction.response.send_message("That's cheating!")
+ else:
+ await interaction.response.send_message(f"You picked {choice.name}.")
+
+
+client.run(TOKEN)
+```
+
+## Development
+
+As well as Python 3.9+, this project requires Poetry for development.
+[Click this link for installation instructions](https://python-poetry.org/docs/master/#installation),
+or:
+
+- #### \*nix (Linux/MacOS)
+
+ `curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -`
+
+- #### Windows Powershell
+
+ `(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -`
+
+Once you have Poetry installed:
+
+1. **Create a virtual environment:** `poetry shell`
+2. **Install dependencies:** `poetry install`
+
+The following commands are then available:
+
+- `poe format` - Run auto-formatting and linting.
+
+Prefix these with `poetry run` if outside of the Poetry shell.
+
+
+
+%prep
+%autosetup -n dslash-0.6.3
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-dslash -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6.3-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..e57ab2c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+997be193e19a9e3ca2ff6637defc916d dslash-0.6.3.tar.gz