Skip to main content

discord.Embed's extensions

Project description

※適当に作ったモジュールのため、バグが発生する可能性があります。もしバグが発生した場合、Discord(Req van Astraea#9732)もしくはTwitter(@Req_fn)までご連絡ください。※

追加されるもの

追加される関数

make - 指定された引数をもとにdiscord.Embedを作成し、返す
author_dict - makeコマンド等でauthorを指定する時にdictの作成を補助する
footer_dict - makeコマンド等でfooterを指定する時にdictの作成を補助する
field_dict - makeコマンド等でfieldを指定する時にdictの作成を補助する

追加されるメソッド

edit - 指定された引数をもとにdiscord.Embed情報を編集する
multiple_add_fields - 一度に複数のfieldを追加する
multiple_remove_fields - 一度に複数のfieldを削除する

各関数、メソッドの使い方

make()

discord_embed_extensions.make(**kwargs)  

Attributes

author
color
description
fields
footer
image
thumbnail
title
url

title

title='title'
Type: str

description

description='description'
Type: str

url

url='url'
Type: str

color

color=color
Type: Union[Colour, int]

footer

footer={'text': 'text', 'icon_url': 'icon_url'}
footer=footer_dict(*, text='text', icon_url='icon_url')
Parameters
・text(str)
・icon_url(str)

image

image='url'
Type: str

thumbnail

thumbnail='url'
Type: str

author

author={'name': 'name', 'url': 'url', 'icon_url': 'icon_url'}
author=author_dict(*, name='name', url='url', icon_url='icon_url')
Parameters
・name(str)
・url(str)
・icon_url(str)

fields

fields=[{'name': 'name', 'value': 'value', 'inline': bool}, {'name': 'name', 'value': 'value', 'inline': bool}]
fields=[field_dict(*, name='name', value='value', inline=bool), field_dict(*, name='name', value='value', inline=bool)]
Parameters
・name(str)
・value(str)
・inline(bool) - default: True

author_dict()

author = discord_embed_extensions.author_dict(**kwargs)  

Attributes

name
url
icon_url

name

name='name'
Type: str

url

url='url'
Type: str

icon_url

icon_url='icon_url'
Type: str

footer_dict()

footer = discord_embed_extensions.footer_dict(**kwargs)  

Attributes

text
icon_url

text

text='text'
Type: str

icon_url

icon_url='icon_url'
Type: str

field_dict()

field = discord_embed_extensions.field_dict(**kwargs)  

Attributes

name
value
inline

name

name='name'
Type: str

value

value='value'
Type: str

inline

inline=[True / False]
Type: bool

edit()

discord.Embed.edit(**kwargs)  

Attributes

author
color
description
footer
image
thumbnail
title
url

title

title='title'
Type: str

description

description='description'
Type: str

url

url='url'
Type: str

color

color=color
Type: Union[Colour, int]

footer

footer={'text': 'text', 'icon_url': 'icon_url'}
footer=footer_dict(*, text='text', icon_url='icon_url')

Parameters
・text(str)
・icon_url(str)

image

image='url'
Type: str

thumbnail

thumbnail='url'
Type: str

author

author={'name': 'name', 'url': 'url', 'icon_url': 'icon_url'}
author=author_dict(*, name='name', url='url', icon_url='icon_url')
Parameters
・name(str)
・url(str)
・icon_url(str)

multiple_add_fields()

discord.Embed.multiple_add_fields(fields)  

Parameters
 fields(dict in list) - makeコマンドと同じ指定方法

.multiple_add_fields([{'name': 'name', 'value': 'value', 'inline': bool}, {'name': 'name', 'value': 'value', 'inline': bool}])
.multiple_add_fields([field_dict(*, name='name', value='value', inline=bool), field_dict(*, name='name', value='value', inline=bool)])

multiple_remove_fields()

インデックスの大きいほうから削除されていくため、インデックスの補完について考える必要はありません

discord.Embed.multiple_remove_fields(indexes)  

Parameters
 indexes(list) - 要素はすべてint、順不同
.multiple_remove_fields([2, 4, 3, 1])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

discord_embed_extensions-1.0.13-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page