-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import nextcord | ||
from cogs.utils.colors import SUCCESS | ||
from cogs.utils.formatting import format_footer | ||
|
||
|
||
class AdView(nextcord.ui.View): | ||
def __init__(self, paid_category=None) -> None: | ||
super().__init__(timeout=None) | ||
self.paid_category = paid_category | ||
|
||
@nextcord.ui.button( | ||
label="Mark Paid", style=nextcord.ButtonStyle.green, custom_id="ticket:paid" | ||
) | ||
async def paid(self, btn: nextcord.ui.Button, inter: nextcord.Interaction): | ||
if isinstance(inter.channel, nextcord.TextChannel): | ||
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.set_footer(text=format_footer(inter.user.id)) | ||
await inter.response.send_message(embed=em) |