This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
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
Benjamin O'Brien
committed
Aug 7, 2020
1 parent
0883884
commit b204f54
Showing
6 changed files
with
126 additions
and
5 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,53 @@ | ||
# Prism Rewrite - Basic Command | ||
|
||
# Modules | ||
import discord | ||
from json import loads, dumps | ||
|
||
from assets.prism import Tools | ||
from discord.ext import commands | ||
|
||
# Main Command Class | ||
class Premium(commands.Cog): | ||
|
||
def __init__(self, bot): | ||
self.bot = bot | ||
self.desc = "Maybe this is where you get premium" | ||
self.usage = "premium" | ||
|
||
@commands.command(aliases = ["upgrade"]) | ||
async def premium(self, ctx, *, sentence: str = None): | ||
|
||
db = loads(open("db/users", "r").read()) | ||
|
||
if not Tools.has_flag(db, ctx.author, "premium"): | ||
|
||
if ctx.author in self.bot.get_guild(729513002302177311).members: | ||
|
||
db[str(ctx.author.id)]["balance"] += 10000 | ||
|
||
db[str(ctx.author.id)]["data"]["tags"].append("premium") | ||
|
||
open("db/users", "w").write(dumps(db, indent = 4)) | ||
|
||
embed = discord.Embed(title = "You have redeemed Prism Premium!", description = "You have gained 10k coins and have a premium badge on your profile.", color = 0x0ee323) | ||
|
||
return await ctx.send(embed = embed) | ||
|
||
has_premium = True if Tools.has_flag(db, ctx.author, "premium") else False | ||
|
||
embed = discord.Embed(title = "Prism Premium :medal:", description = f"Bragging rights for everbody :)\nPremium status: {has_premium}", color = 0x126bf1) | ||
|
||
embed.add_field(name = "Benefits", value = ":medal: Exclusive badge on your profile\n:moneybag: Payout of 10k daily coins\n:man_scientist: Access to expirimental commands\n:name_badge: Access to premium-only commands\n:man_artist: Future access to the character customizer", inline = False) | ||
|
||
embed.add_field(name = "How to get premium", value = "Prism will never be a paid-for bot; which means premium is\ncompletely free.\n\nTo get premium follow these steps:\n1. Join `discord.gg/KhvXWTr`.\n2. Reuse the `premium` command.\n3. Tada, Prism should let you redeem premium. :D", inline = False) | ||
|
||
embed.set_author(name = " | Premium", icon_url = self.bot.user.avatar_url) | ||
|
||
embed.set_footer(text = f" | Requested by {ctx.author}.", icon_url = ctx.author.avatar_url) | ||
|
||
return await ctx.send(embed = embed) | ||
|
||
# Link to bot | ||
def setup(bot): | ||
bot.add_cog(Premium(bot)) |
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,51 @@ | ||
# Prism Rewrite - Basic Command | ||
|
||
# Modules | ||
import discord | ||
from assets.prism import Tools | ||
|
||
from discord.ext import commands | ||
|
||
# Main Command Class | ||
class Fakeban(commands.Cog): | ||
|
||
def __init__(self, bot): | ||
self.bot = bot | ||
self.desc = "Bans a member on the server" | ||
self.usage = " ban [user] [reason]" | ||
|
||
@commands.command() | ||
@commands.has_permissions(ban_members = True) | ||
async def bban(self, ctx, user: discord.Member = None, *, reason: str = None): | ||
|
||
if not user: | ||
|
||
return await ctx.send(embed = Tools.error("Please specify a user to ban.")) | ||
|
||
elif user.id == ctx.author.id: | ||
|
||
return await ctx.send(embed = Tools.error("Stop trying to ban yourself lmao")) | ||
|
||
elif user.id == self.bot.user.id: | ||
|
||
await ctx.send("If that's what you really want, then aight.") | ||
|
||
return await ctx.guild.leave() | ||
|
||
if reason: | ||
|
||
if len(reason) > 512: | ||
|
||
return await ctx.send(embed = Tools.error("You can't have a reason over 512 characters.")) | ||
|
||
embed = discord.Embed(title = f"{ctx.author.name} just banned {user.name} from the server.", description = reason, color = 0x126bf1) | ||
|
||
embed.set_author(name = " | Ban", icon_url = self.bot.user.avatar_url) | ||
|
||
embed.set_footer(text = f" | Banned by {ctx.author}.", icon_url = ctx.author.avatar_url) | ||
|
||
return await ctx.send(embed = embed) | ||
|
||
# Link to bot | ||
def setup(bot): | ||
bot.add_cog(Fakeban(bot)) |
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
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