Skip to content

Commit

Permalink
Merge pull request #41 from npostring/master
Browse files Browse the repository at this point in the history
Discord.py v2.0 におけるエラー修正
  • Loading branch information
1ntegrale9 authored Jan 27, 2023
2 parents b6e7f59 + ac684d3 commit 8144632
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dispander/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import discord
from discord import Embed
from discord.embeds import EmptyEmbed
from discord.ext import commands
import re

Expand Down Expand Up @@ -105,8 +104,8 @@ async def dispand(message):
await main_message.add_reaction(DELETE_REACTION_EMOJI)
main_embed = main_message.embeds[0]
main_embed.set_author(
name=getattr(main_embed.author, "name", EmptyEmbed),
icon_url=getattr(main_embed.author, "icon_url", EmptyEmbed),
name=getattr(main_embed.author, "name", None),
icon_url=getattr(main_embed.author, "icon_url", None),
url=make_jump_url(message, m, sent_messages)
)
await main_message.edit(embed=main_embed)
Expand Down Expand Up @@ -172,12 +171,12 @@ def compose_embed(message):
)
embed.set_author(
name=message.author.display_name,
icon_url=message.author.avatar_url,
icon_url=message.author.avatar or f'{discord.Asset.BASE}/embed/avatars/{discord.DefaultAvatar.red}.png',
url=message.jump_url
)
embed.set_footer(
text=message.channel.name,
icon_url=message.guild.icon_url,
icon_url=message.guild.icon or f'{discord.Asset.BASE}/embed/avatars/{discord.DefaultAvatar.red}.png',
)
if message.attachments and message.attachments[0].proxy_url:
embed.set_image(
Expand Down

0 comments on commit 8144632

Please sign in to comment.