summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-31 04:30:35 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-31 04:30:35 +0000
commitab9bf143ea54b1902461378a1e6f2d34ae9cbc44 (patch)
treecabcf7abe23931615849b149c2a23a4f9ca7af4d
parent5cb9b382790c3b5bda9bcfbae216cae201c6fe20 (diff)
automatic import of python-discord-py-embed-wrapper
-rw-r--r--.gitignore1
-rw-r--r--python-discord-py-embed-wrapper.spec327
-rw-r--r--sources1
3 files changed, 329 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..6dfa359 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/discord.py-embed-wrapper-0.0.9.tar.gz
diff --git a/python-discord-py-embed-wrapper.spec b/python-discord-py-embed-wrapper.spec
new file mode 100644
index 0000000..4936d25
--- /dev/null
+++ b/python-discord-py-embed-wrapper.spec
@@ -0,0 +1,327 @@
+%global _empty_manifest_terminate_build 0
+Name: python-discord.py-embed-wrapper
+Version: 0.0.9
+Release: 1
+Summary: A small wrapper for easy creation of discord.py Embeds and sending/editing of Messages including those Embeds
+License: MIT License
+URL: https://gitlab.com/sleoh/discord.py-embed-wrapper
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f6/8d/177b22211b6edc047b8b4a9fd37e0f005b16358455e38a7e604186f2c797/discord.py-embed-wrapper-0.0.9.tar.gz
+BuildArch: noarch
+
+
+%description
+# DISCLAIMER!
+### This package is only vaguely tested.
+
+# Installing
+### Python 3.6 or higher is required
+other than that it's just as simple as
+```
+pip install discord.py-embed-wrapper
+```
+```python
+from embed_wrapper import *
+```
+
+# Wrapper Classes - Examples/Usage
+### EmbedField
+to create an `EmbedField` object
+```python
+wrapped_field = EmbedField(name=field_name, value=field_value, inline=field_inline)
+```
+
+and then use it in the initialisation of an `EmbedWrapper`
+### EmbedWrapper
+```python
+embed_wrapper = EmbedWrapper(
+ author_name=author_name, author_url=author_url, author_icon_url=author_icon_url,
+ embed_type=embed_type, title=title, url=url, color=color, description=description,
+ timestamp=timestamp,
+ footer_text=footer_text, footer_icon_url=footer_icon_url,
+ image_url=image_url, thumbnail_url=thumbnail_url,
+ fields=[wrapped_field]
+)
+```
+to finalize and instantiate the embed from the wrapper call
+```python
+embed = embed_wrapper.embed
+```
+
+# Helper Functions - Examples/Usage
+### embeds_from_message
+Creates a List of Embeds from a give Message. Returns None if the given Message didn't have any Embeds.
+```python
+def embeds_from_message(message: Message) -> Optional[List[Embed]]:
+ ...
+
+embeds = embeds_from_message(message=message)
+```
+### send_embed_message
+Sends a Message including an Embed to either a Guild TextChannel or a DMChannel and returns the sent Message.
+```python
+async def send_embed_message(
+ embed: Embed,
+ invoking_message: Message,
+ as_reply: bool = False,
+ as_dm: bool = False,
+ dm_channel: DMChannel = None,
+ pin: bool = False,
+ message_content: str = "",
+ reactions: List[str] = None,
+ mentions: List[Union[User, Member, Role]] = None,
+ append_mentions: bool = False
+) -> Message:
+...
+```
+simplest usage
+```python
+embed_message = await send_embed_message(embed=embed, invoking_message=message)
+```
+Sends an Embed Message only containing the embed in the same channel it was invoked.
+### edit_embed_message
+Edits a given Embed Message with a new Embed and optionally new Message Content and returns the edited Message. Pass None as the Embed to remove it.
+```python
+async def edit_embed_message(
+ embed: Embed,
+ message: Message,
+ message_content: Optional[str],
+) -> Message:
+...
+```
+usage
+```python
+embed_message = await edit_embed_message(embed=embed, message=embed_message)
+```
+
+
+
+
+
+%package -n python3-discord.py-embed-wrapper
+Summary: A small wrapper for easy creation of discord.py Embeds and sending/editing of Messages including those Embeds
+Provides: python-discord.py-embed-wrapper
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-discord.py-embed-wrapper
+# DISCLAIMER!
+### This package is only vaguely tested.
+
+# Installing
+### Python 3.6 or higher is required
+other than that it's just as simple as
+```
+pip install discord.py-embed-wrapper
+```
+```python
+from embed_wrapper import *
+```
+
+# Wrapper Classes - Examples/Usage
+### EmbedField
+to create an `EmbedField` object
+```python
+wrapped_field = EmbedField(name=field_name, value=field_value, inline=field_inline)
+```
+
+and then use it in the initialisation of an `EmbedWrapper`
+### EmbedWrapper
+```python
+embed_wrapper = EmbedWrapper(
+ author_name=author_name, author_url=author_url, author_icon_url=author_icon_url,
+ embed_type=embed_type, title=title, url=url, color=color, description=description,
+ timestamp=timestamp,
+ footer_text=footer_text, footer_icon_url=footer_icon_url,
+ image_url=image_url, thumbnail_url=thumbnail_url,
+ fields=[wrapped_field]
+)
+```
+to finalize and instantiate the embed from the wrapper call
+```python
+embed = embed_wrapper.embed
+```
+
+# Helper Functions - Examples/Usage
+### embeds_from_message
+Creates a List of Embeds from a give Message. Returns None if the given Message didn't have any Embeds.
+```python
+def embeds_from_message(message: Message) -> Optional[List[Embed]]:
+ ...
+
+embeds = embeds_from_message(message=message)
+```
+### send_embed_message
+Sends a Message including an Embed to either a Guild TextChannel or a DMChannel and returns the sent Message.
+```python
+async def send_embed_message(
+ embed: Embed,
+ invoking_message: Message,
+ as_reply: bool = False,
+ as_dm: bool = False,
+ dm_channel: DMChannel = None,
+ pin: bool = False,
+ message_content: str = "",
+ reactions: List[str] = None,
+ mentions: List[Union[User, Member, Role]] = None,
+ append_mentions: bool = False
+) -> Message:
+...
+```
+simplest usage
+```python
+embed_message = await send_embed_message(embed=embed, invoking_message=message)
+```
+Sends an Embed Message only containing the embed in the same channel it was invoked.
+### edit_embed_message
+Edits a given Embed Message with a new Embed and optionally new Message Content and returns the edited Message. Pass None as the Embed to remove it.
+```python
+async def edit_embed_message(
+ embed: Embed,
+ message: Message,
+ message_content: Optional[str],
+) -> Message:
+...
+```
+usage
+```python
+embed_message = await edit_embed_message(embed=embed, message=embed_message)
+```
+
+
+
+
+
+%package help
+Summary: Development documents and examples for discord.py-embed-wrapper
+Provides: python3-discord.py-embed-wrapper-doc
+%description help
+# DISCLAIMER!
+### This package is only vaguely tested.
+
+# Installing
+### Python 3.6 or higher is required
+other than that it's just as simple as
+```
+pip install discord.py-embed-wrapper
+```
+```python
+from embed_wrapper import *
+```
+
+# Wrapper Classes - Examples/Usage
+### EmbedField
+to create an `EmbedField` object
+```python
+wrapped_field = EmbedField(name=field_name, value=field_value, inline=field_inline)
+```
+
+and then use it in the initialisation of an `EmbedWrapper`
+### EmbedWrapper
+```python
+embed_wrapper = EmbedWrapper(
+ author_name=author_name, author_url=author_url, author_icon_url=author_icon_url,
+ embed_type=embed_type, title=title, url=url, color=color, description=description,
+ timestamp=timestamp,
+ footer_text=footer_text, footer_icon_url=footer_icon_url,
+ image_url=image_url, thumbnail_url=thumbnail_url,
+ fields=[wrapped_field]
+)
+```
+to finalize and instantiate the embed from the wrapper call
+```python
+embed = embed_wrapper.embed
+```
+
+# Helper Functions - Examples/Usage
+### embeds_from_message
+Creates a List of Embeds from a give Message. Returns None if the given Message didn't have any Embeds.
+```python
+def embeds_from_message(message: Message) -> Optional[List[Embed]]:
+ ...
+
+embeds = embeds_from_message(message=message)
+```
+### send_embed_message
+Sends a Message including an Embed to either a Guild TextChannel or a DMChannel and returns the sent Message.
+```python
+async def send_embed_message(
+ embed: Embed,
+ invoking_message: Message,
+ as_reply: bool = False,
+ as_dm: bool = False,
+ dm_channel: DMChannel = None,
+ pin: bool = False,
+ message_content: str = "",
+ reactions: List[str] = None,
+ mentions: List[Union[User, Member, Role]] = None,
+ append_mentions: bool = False
+) -> Message:
+...
+```
+simplest usage
+```python
+embed_message = await send_embed_message(embed=embed, invoking_message=message)
+```
+Sends an Embed Message only containing the embed in the same channel it was invoked.
+### edit_embed_message
+Edits a given Embed Message with a new Embed and optionally new Message Content and returns the edited Message. Pass None as the Embed to remove it.
+```python
+async def edit_embed_message(
+ embed: Embed,
+ message: Message,
+ message_content: Optional[str],
+) -> Message:
+...
+```
+usage
+```python
+embed_message = await edit_embed_message(embed=embed, message=embed_message)
+```
+
+
+
+
+
+%prep
+%autosetup -n discord.py-embed-wrapper-0.0.9
+
+%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-discord.py-embed-wrapper -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.9-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..505a591
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+906934b42bc98a96c5e616dfc6320310 discord.py-embed-wrapper-0.0.9.tar.gz