Skip to content

Commit

Permalink
fix: ad didn't send ad content
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Dec 17, 2023
1 parent b1fc445 commit 502e293
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
48 changes: 36 additions & 12 deletions cogs/inquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from nextcord.ext import commands
import nextcord
from os import getenv
from .utils.colors import EMBED_COLOR, SUCCESS, INQUIRY, REPLY
from .utils.colors import EMBED_COLOR, SUCCESS, INQUIRY, REPLY, AD_EM_COLOR
from .utils.formatting import format_footer

load_dotenv()
Expand Down Expand Up @@ -161,18 +161,42 @@ async def accept(self, btn: nextcord.ui.Button, inter: nextcord.Interaction):
f"Ticket created: <#{new_channel.id}>", ephemeral=True
)
em = nextcord.Embed()
em.color = INQUIRY
em.set_author(name=f"{name} inquired:", icon_url=person.avatar)
em.description = content
em.set_footer(text=format_footer(id))
if inter.channel.id == AD_CHANNEL:
# IS AD
em.color = SUCCESS
em.set_author(
name=f"{name} requested an advertisement:", icon_url=person.avatar
)
em.description = content
em.set_footer(text=format_footer(id))

await new_channel.set_permissions(
person, send_messages=True, read_messages=True
)
await new_channel.send(
content=f"<@{id}>",
embed=em,
)
await new_channel.set_permissions(
person, send_messages=True, read_messages=True
)
await new_channel.send(
content=f"<@{inter.user.id}> <@{ADVERTISING_ROLE}>",
embed=em,
view=AdView(),
)
emb = nextcord.Embed()
emb.color = 0xE67E22
emb.title = "__**Advertisement Services**__"
emb.description = """:bell: $40 = Ping @ everyone with ad message/links\n\n:gift: $45 = Hosted Nitro Giveaway Ad with @ everyone ping (Nitro must be supplied by the customer)\n\n*These prices apply to the Vanilla PvP Community/Tier List*"""
await new_channel.send(embed=emb)

else:
em.color = INQUIRY
em.set_author(name=f"{name} inquired:", icon_url=person.avatar)
em.description = content
em.set_footer(text=format_footer(id))

await new_channel.set_permissions(
person, send_messages=True, read_messages=True
)
await new_channel.send(
content=f"<@{id}>",
embed=em,
)

@nextcord.ui.button(
label="Quick Response",
Expand Down
1 change: 1 addition & 0 deletions cogs/utils/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
INQUIRY = 0xC33C3C # red
REPLY = 0x398A9E # blue
CLOSE_REQUEST = 0x3498DB
AD_EM_COLOR = 0xE67E22

0 comments on commit 502e293

Please sign in to comment.