Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Dec 22, 2023
1 parent 843c67d commit bee3d80
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ REQUEST_CHANNEL=

ADVERTISING_ROLE=
AD_CHANNEL=
AD_CATEGORY
AD_CATEGORY=
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ cython_debug/
#.idea/


marlow-bot/
contact-request-bot

config.json

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# marlow-dm-bot
# contact-request-bot
14 changes: 6 additions & 8 deletions cogs/inquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
REQUEST_CHANNEL = int(getenv("REQUEST_CHANNEL"))
ADVERTISING_ROLE = int(getenv("ADVERTISING_ROLE"))
AD_CHANNEL = int(getenv("AD_CHANNEL"))
DEPLOY_DESC = getenv("DEPLOY_DESC")
FORM_TITLE = getenv("FORM_TITLE")
PAYMENT_DESC = getenv("PAYMENT_DESC")


class TicketView(nextcord.ui.View):
Expand Down Expand Up @@ -183,7 +186,7 @@ async def accept(self, btn: nextcord.ui.Button, inter: nextcord.Interaction):
emb = nextcord.Embed()
emb.color = AD_EM_COLOR
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*"""
emb.description = PAYMENT_DESC
await new_channel.send(embed=emb)

else:
Expand Down Expand Up @@ -257,7 +260,7 @@ async def callback(self, inter: nextcord.Interaction) -> None:
class QuestionForm(nextcord.ui.Modal):
def __init__(self):
super().__init__(
title="Contact Marlow",
title=FORM_TITLE,
custom_id="questionform:question",
timeout=None,
)
Expand Down Expand Up @@ -311,12 +314,7 @@ async def deploy(self, inter: nextcord.Interaction) -> None:
if isinstance(inter.channel, nextcord.TextChannel):
em = nextcord.Embed(
title="📫 Contact Request",
description="""
Due to an influx of messages, I have decided to use requests to filter spam while still providing a means for important inquiries to be made.
I cannot guarantee a response to each inquiry.
Please reserve this system for important reasons.
""",
description=DEPLOY_DESC,
color=EMBED_COLOR,
)

Expand Down
21 changes: 16 additions & 5 deletions views/ad.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import nextcord
from cogs.utils.colors import SUCCESS
from os import getenv
from dotenv.main import load_dotenv

load_dotenv()

AD_PAID_DESC = getenv("AD_PAID_DESC")
AD_PAID_TITLE = getenv("AD_PAID_TITLE")


class AdView(nextcord.ui.View):
Expand All @@ -13,12 +20,16 @@ def __init__(self, paid_category=None, advertising_role=None) -> None:
)
async def paid(self, btn: nextcord.ui.Button, inter: nextcord.Interaction) -> None:
if isinstance(inter.channel, nextcord.TextChannel):
print(self.advertising_role)
if inter.permissions.administrator or (nextcord.utils.get(inter.guild.roles, id=self.advertising_role) in inter.roles):
category = nextcord.utils.get(inter.guild.categories, id=self.paid_category)
if inter.permissions.administrator or (
nextcord.utils.get(inter.guild.roles, id=self.advertising_role)
in inter.roles
):
category = nextcord.utils.get(
inter.guild.categories, id=self.paid_category
)
await inter.channel.edit(category=category)
em = nextcord.Embed()
em.color = SUCCESS
em.title = ":checkmark: Payment Received"
em.description = """Thank you for your purchase!\nIf you haven't already, please send your advertisement message and ensure if you are using any custom/nitro-accessed Emojis that they are present within the Discord you are advertising (emojis from our server are fine, too).\n\nIf another advertisement was recently posted, out of courtesy it will be given a reasonable amount of uptime before yours is posted."""
em.title = AD_PAID_TITLE
em.description = AD_PAID_DESC
await inter.response.send_message(embed=em)

0 comments on commit bee3d80

Please sign in to comment.