async def car(self, ctx, id): try: id2 = id.replace("_", " ") print(id2) except: print('not replaced') pass text = requests.get('https://www.nitrotype.com/index/d8dad03537419610ef21782a075dde2d94c465c61266-1266/bootstrap.js').text result = re.search(r'\[\{\"id\"\:\d+,\"carID\":\d+.*\]', text).group() data = json.loads('{"list": '+''.join(list(result)[:-1])+'}') for elem in data['list']: for v in elem.values(): try: if re.search(str(id2).lower(), str(v).lower()).group(): cardata = elem break except: continue else: continue break else: embed = Embed(':frame_photo: Car Image', 'Search Query: `'+str(id2)+'`') embed.field('Results', 'None') embed.footer('Not the car you\'re looking for? Replace all spaces with _ .') return await embed.send(ctx) embed = Embed('Car Image', 'Search Query: `'+str(id)+'`') embed.image('https://www.nitrotype.com/cars/'+cardata['options']['largeSrc']) embed.footer('Not the car you\'re looking for? Replace all spaces with _ .') for k, v in cardata.items(): embed.field(k, v) return await embed.send(ctx)
async def invite(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') embed = Embed( 'Here\'s your link!', 'Thank you for deciding to invite this bot to your server!\n\nAdd Lacan NTSport to your server!\n\n__What we offer:__\n\n:small_blue_diamond: Unique NT user stats (like settings and country) brought to you.\n:small_blue_diamond: Team Stats\n:small_blue_diamond: Send cash feature\n:small_blue_diamond: Car guessing game\n:small_blue_diamond: Typing race\n:small_blue_diamond: Economy system\n:small_blue_diamond: Register your NT account to the bot!\n:small_blue_diamond: Team competition hosting for a custom amount of time.\n:small_blue_diamond: Leaderboards\n\n__Premium :diamond_shape_with_a_dot_inside: (Run `n.premium` for more info!) :__\n\n:small_orange_diamond: Updating speed, accuracy, gold, races and registered role through the command `n.update` -> Lacan NTSport is the only Bot which does that for NT cash instead of in real life cash! \n:small_orange_diamond: Updating nickname to `[TAG] Display name`\n:small_orange_diamond: Add team member roles to team members in supported teams.\n\n__Coming soon:__\n\n:small_blue_diamond: Giveaways with epic additional Nitrotype features!\n\nAdd one of the best NT stats tracking bots to your server **today**! :grinning:\n\nInvite me [here](https://discord.com/api/oauth2/authorize?client_id=713352863153258556&permissions=8&redirect_uri=https%3A%2F%2Fnitrotype.com&scope=bot) for administrator permissions (not recommended). \nInvite me [here](https://discord.com/oauth2/authorize?client_id=713352863153258556&permissions=2617633857&redirect_uri=https%3A%2F%2Fnitrotype.com&scope=bot) for the required permissions (recommended).\n\nBy using you agree to create a temporary (5 minutes lasting) invite for easier support.', 'link') if (ctx.author.id) in [ 396075607420567552, 505338178287173642, 637638904513691658 ]: embed.footer( f'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. ', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) else: embed.footer( f'' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is attempting to invite me to a server.💗 \n Become a premium 💠 member today!', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) await embed.send(ctx) try: await ctx.message.delete() except: pass
async def sent(self, ctx, sendto: discord.User, amount): if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed = Embed( 'Error!', 'Lol, did you really think it\'s possible for you to use this command 5540097> when you are not a dev? Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) await embed.send(ctx) return try: await sendto.send( f'Developer {ctx.author} just paid out the **{amount}** <:Lacan:766669740545540097> (worth {str(int(amount)*1000)} NT Cash). Check your NT account in order to get the cash.' ) embed = Embed( 'Success', f'{ctx.author} just paid out the **{amount}** <:Lacan:766669740545540097> (worth {str(int(amount)*1000)} NT Cash).', 'white check mark') except Exception: embed = Embed( 'Error!', '' + sendto.mention + ' has received ' + str(ctx.author) + '\'s **' '** <:Lacan:766669740545540097>, but they have their DMs turned off so I couldn\'t Direct message ' + sendto.mention + '.', 'warning') await embed.send(ctx) try: await ctx.message.delete() except: pass return
async def remove(self, ctx, userid, amount): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if (ctx.author.id) not in [505338178287173642, 637638904513691658, 396075607420567552]: embed = Embed('Error!', 'Lol, did you really think it\'s possible for you to add <:Lacan:766669740545540097> to a user when you are not a dev? Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer('⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png') await embed.send(ctx) return #data = json.loads(requests.get('https://pointsdb.nitrotypers.repl.co', data={'key': os.getenv('DB_KEY')}).text)['data'] dbclient = DBClient() collection = dbclient.db.pointsdb data = await dbclient.get_array(collection, {'$and': [{'userid': str(userid)}, {'userid': str(userid)}]}) async for d in data: user = d break try: old = user.copy() if user['userid'] == str(userid): user['points'] -= int(amount) userpoints = user['points'] data = await dbclient.update_array(collection, old, user) except: dbclient.create_doc(collection, {'userid': str(userid), 'points': userpoints}) embed = Embed('Success!', f'<@{ctx.author.id}> just removed **{amount}** <:Lacan:766669740545540097> from <@{userid}>\'s balance. \n<@{userid}> now has **{userpoints}** <:Lacan:766669740545540097>!', 'white_check_mark') embed.footer('Discord user '+str(ctx.author.name + '#' + ctx.author.discriminator)+' is a developer of this bot. \n⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png') try: await ctx.message.delete() except: pass await embed.send(ctx)
async def verify(ctx): dbclient = clientDB() collection = dbclient.db.NT_to_discord dbdata = await dbclient.get_array(collection, {'userID': str(ctx.author.id)}) async for elem in dbdata: if elem['userID'] == str(ctx.author.id): racer = await Racer(elem['NTuser']) if elem['verified'] == 'false': if len(racer.carIDs) > 1: while True: verifycar = cars[random.choice(racer.carIDs)] if verifycar == racer.current_car: continue else: break embed = Embed('Instructions', 'Go to your [Garage](https://nitrotype.com/garage), switch your car to **__' + verifycar + '__** and type `n.verify` again. \n\n *(Please note that this could take up to 15 minutes to work.)*', 'clipboard') await embed.send(ctx) elem['verifyCar'] = verifycar elem['verified'] = 'in progress' #requests.post('https://test-db.nitrotypers.repl.co', data={"key": dbkey, "data": json.dumps(dbdata)}) dbclient = clientDB() collection = dbclient.db.NT_to_discord await dbclient.update_big_array(collection, 'registered', dbdata) break if len(racer.carIDs) <= 1: embed = Embed('Error', 'Get another car before trying to verifying!', 'warning') if elem['verified'] == 'in progress': if elem['verifyCar'] == racer.current_car: elem['verified'] = 'true' #requests.post('https://test-db.nitrotypers.repl.co', data={"key": dbkey, "data": json.dumps(dbdata)}) dbclient = clientDB() collection = dbclient.db.NT_to_discord await dbclient.update_big_array(collection, 'registered', dbdata) embed = Embed('<a:Check:797009550003666955> Success', 'You\'ve been verified! In case this is a premium 💠server do `n.update` to update your roles.') await embed.send(ctx) break else: embed = Embed('<a:error:800338727645216779> Oh No!', f'Remember to switch your car to **__{elem["verifyCar"]}__**. \nIf there is a problem, just wait a few minutes before trying again. \n\n***(If you just registered, make sure to wait 15 minutes so that I can recognize your equipped car.)*** \n\nIf any problems occur, please make sure to ping / DM **one** of the following people who are able to register you: \n\n**__Developers:__** \n<@505338178287173642> \n<@637638904513691658> \n<@396075607420567552> \n\n**__Helpers:__**\n<@630761745140547625>\n<@731041476322263050> \n<@527937153817116704>') await embed.send(ctx) break if elem['verified'] == 'true': embed = Embed('LOL', 'You already registered and verified silly!\nIn case this is a premium 💠server do `n.update` to update your roles.', 'rofl') if (ctx.author.id) not in [505338178287173642, 637638904513691658, 396075607420567552]: embed.footer('Make sure to use n.verify after waiting 15 minutes!\n Become a premium 💠member today! Run n.premium for more info.', 'https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif') else: embed.footer('Discord user '+str(ctx.author.name + '#' + ctx.author.discriminator)+' is a developer of this bot.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png') await embed.send(ctx) break #if the for loop doesn't "break" else: embed = Embed('<a:error:800338727645216779> Error!', 'Your account isn\'t registered yet.\nAlready registered? Make sure to run `n.verify` to verify your ownership!') await embed.send(ctx) return
async def delroles(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if (ctx.author.id) not in [505338178287173642, 396075607420567552]: embed = Embed( 'Error!', 'You\'re not a developer of this bot! Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( f'⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) return await embed.send(ctx) listofroles = [ "Gold Member", ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy", "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM", "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] achievementroles = [ '"I < 3 Typing"', '"I Really Love Typing!"', '"Bonkers About Typing"', '"Bananas About Typing"', '"You\'ve Gotta Be Kidding"', '"Corsair"', '"Pirc"', '"Carrie"', '"Anne"', '"Lackin\' Nothin\'"', '"Outback Officer"', '"I Love Shoes 2"', '"I Love Shoes 12.5"', '"I Love Shoes 15.0"', '"I Love Shoes 20.0"', '"The Wildest of Flowers"', '"The Wild Legend"' ] guild = ctx.guild for role in guild.roles: if str(role.name) in listofroles or str( role.name) in achievementroles: await role.delete() continue embed = Embed( 'Success!', f'The roles for `{str(ctx.author.guild.id)}` were deleted by ' + str(ctx.author.name + '#' + ctx.author.discriminator) + '.', 'white_check_mark') embed.footer( f'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot.\n⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) await embed.send(ctx)
async def meme(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if await ImproperType.check(ctx): return post = self.fetcher.image() if post == None: embed = Embed('Error!', 'We couldn\'t fetch the memes!', 'sob') embed = Embed('', f':frame_photo: **[{post["title"]}]({post["url"]})**') embed.image(post['image']) embed.footer(f'👍{post["upvotes"]:,d} | 💬{post["comments"]:,d}') await embed.send(ctx)
async def rules(self, ctx): if await ImproperType.check(ctx): return embed = Embed('Rules', 'This bot\'s rules, make sure to follow them!', 'scroll') embed.field( 'Rule 1', '__Begging is prohibited.__\n\nBegging for any currency, races or account selling or trading is strictly prohibited.' ) embed.field( 'Rule 2', '__No inappropriate command language.__\n\nThis is a clean bot, any use of commands with any sexual language or harashment comments within the `n.` prefix are not allowed.' ) embed.field( 'Rule 3', '__Respect Discord and NitroType TOS.__\n\nAs a verified discord bot for NitroType, in order to use this bot you have to respect the discord and NitroType TOS.' ) embed.field( 'Rule 4', '__No autotypers or other kind of bots.__\n\nAuto typers or other features making it easier for you to earn currency are strictly prohibited and will (in most of the cases) result in a global ban from the bot.' ) embed.field( 'Rule 5', '__No currency exchange.__\n\nTrading this bot\'s currency for dank memer cash / Nitro Type cash / other currencies is prohibited.' ) embed.field( 'Rule 6', '__No raiding.__\n\nAdding this bot to small servers just to then run commands on autotypers without even answering, just to make sure the bot developer has a hard time with the bot\'s uptime, is strictly prohibited and will have the same consequences as rule 4.' ) embed.field( 'Rule 7', '__Personal information written to the bot remains private.__\n\nAsking for personal information, such as password shared to the bot before is not allowed.' ) embed.field( 'Rule 8', '__No complaining without reading.__\n\nPlease abide from complaining about the bot (for example verification waiting times) if it clearly states that this feature takes its time.' ) embed.field( 'Rule 9', '__No scamming or botting support.__\n\nThis bot does not support botters or scammers and it\'s not allowed to use it for any features like that.' ) embed.field( 'Rule 10', '__Reuse of the code is not permitted.__\n\nThe code for this bot is public, but any reuse of the code is strictly prohibited and subject to an immediate ban from the bot.' ) embed.footer( str(ctx.author) + ' • © 2020 / 2021 Try2Win4Glory, adl212, Typerious') return await embed.send(ctx)
async def news(self, ctx): if await ImproperType.check(ctx): return page = 0 def check(reaction: Reaction, user: User): return user.id == ctx.author.id #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') news = await News() news = news.data[page] embed = Embed( '', f':race_car: ***[{news["title"]}]({news["link"]})***\n{news["description"]}' ) embed.footer(f'{news["author"]} wrote this on {news["created"]} UTC') embed.image(news['image']) message = await ctx.send(embed=embed.default_embed(), content=None) await message.add_reaction('🔄') while True: try: reaction, user = await self.client.wait_for('reaction_add', timeout=120, check=check) except TimeoutError: await reaction.delete() break else: if str(reaction) == '🔄': news = await News() page = cycle_news(news.data, page) news = await News() news = news.data[page] embed = Embed( '', f':race_car: ***[{news["title"]}]({news["link"]})***\n{news["description"]}' ) embed.footer( f'{news["author"]} wrote this on {news["created"]} UTC' ) embed.image(news['image']) await message.remove_reaction(reaction, user) await message.edit(embed=embed.default_embed()) else: await message.remove_reaction(reaction, user)
async def premium(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if await ImproperType.check(ctx): return embed = Embed( 'Premium', 'Premium is a one time purchase for your Discord server. \n It will make your server appearance a lot better. \n There are lots of benefits you will get for being a premium server. \n \n Your benefits are: \n :small_blue_diamond: **LIFETIME** server access to **all** features of this bot. \n :small_blue_diamond: You don\'t have to do anything, the bot will create speed, gold member, accuracy and race roles for your server. \n :small_blue_diamond: Role registering / updating system through the command `n.update`. \n :small_blue_diamond: Nickname updating system through the command `n.update`. \n :small_blue_diamond: The feeling that you helped the developers a lot through your purchasement. \n :small_blue_diamond: More things coming soon:tm:, so stay tuned. \n \n :small_orange_diamond: In order to receive these Premium features, check your class down below. Then send `10M` to [this](https://nitrotype.com/racer/hypertyper55) account and DM <@505338178287173642> on discord.', 'diamond_shape_with_a_dot_inside') #\n\n **__List of Premium 💠Server Prizes__** (since December 20th 2020)\n\n:small_orange_diamond: ***Class I:*** Human Members: __<50__, Age: __>3 months__: `5M`.\n\n:small_orange_diamond: ***Class II:*** Human members: __50-99__, Age: __>3 months__: `10M`.\n\n:small_orange_diamond: ***Class III:*** Human members: 100-150, Age: __>3 months__: `15M`. \n\n:small_orange_diamond: ***Class IV:*** Human members: __150-199__, Age __>3 months__: `20M`. \n\n:small_orange_diamond: ***Class V: ***Human members: __200+__, Age: __>3 months__: `25M`. \n\n:small_orange_diamond: ***Class VI: ***Human members: __ANY__, Age: __<3 months__: `20M`.') embed.footer( f'{ctx.author} • Become a premium 💠member today! 💗') embed.thumbnail( 'https://media.discordapp.net/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) await embed.send(ctx) try: await ctx.message.delete() except: pass
async def cars(self, ctx, user=None): dbclient = DBClient() collection = dbclient.db.pointsdb dbdata = await dbclient.get_array( collection, { '$and': [{ 'userid': str(ctx.author.id) }, { 'userid': str(ctx.author.id) }] }) async for d in dbdata: data = d break page = 0 def check(reaction: Reaction, user: User): return user.id == ctx.author.id embed = Embed('Cars You Own!', 'The cars you bought with lacans!') embed.field('Equipped Car!', data['equipped']['car']) embed.image('https://www.nitrotype.com/cars/' + data['equipped']['img'].replace('small', 'large')) embed.footer('You can buy cars or equip cars using n.buy or n.equip!') message = await ctx.send(embed=embed.default_embed()) await message.add_reaction('🔄') while True: try: reaction, user = await self.client.wait_for('reaction_add', timeout=120, check=check) except TimeoutError: break embed = Embed('Cars You Own!', 'The cars you bought with lacans!') embed.field(f'Car Index {page+1}', data["cars"][page]["car"]) embed.image( f"https://www.nitrotype.com/cars/{data['cars'][page]['img'].replace('small', 'large').strip()}" ) await message.remove_reaction(reaction, user) await message.edit(embed=embed.default_embed()) page += 1 if page >= len(data['cars']): page = 0
async def addpremium(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if (ctx.author.id) not in [396075607420567552, 505338178287173642, 637638904513691658]: embed = Embed('Error!', 'You\'re not a developer of this bot! Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer(f'⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png') return await embed.send(ctx) #data = json.loads(requests.get('https://test-db.nitrotypers.repl.co', data={'key': os.getenv('DB_KEY')}).text) dbclient = DBClient() collection = dbclient.db.premium data = await dbclient.get_big_array(collection, 'premium') for x in data['premium']: if x['serverID'] == str(ctx.author.guild.id): embed = Embed('Error!', 'This server is already premium!', 'warning') embed.footer(f'⚙️This command is a 🛠️developer🛠️ only command.⚙️','https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png') return await embed.send(ctx) data['premium'].append({'serverID': str(ctx.author.guild.id)}) #requests.post('https://test-db.nitrotypers.repl.co', data={'key': os.getenv('DB_KEY'), 'data': json.dumps(data)}) await dbclient.update_big_array(collection, 'premium', data) embed = Embed('Success!', f'Server {str(ctx.author.guild.id)} has been added to premium! Run `n.roles` to create the roles for the server!', 'white_check_mark') embed.footer(f'⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png') await embed.send(ctx) try: await ctx.message.delete() except: pass
async def unban(self, ctx, userid): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if ctx.author.id not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed = Embed('Error!', 'You are not a dev!', 'warning') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️ \nBecome a premium 💠 member today!', 'https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif' ) else: embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️ \nDiscord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) return await embed.send(ctx) else: #data = json.loads(requests.get('https://blacklisted-db.nitrotypers.repl.co', data={"key": os.getenv('DB_KEY')}).text)['data'] dbclient = DBClient() collection = dbclient.db.blacklisted data = await dbclient.get_big_array(collection, 'banned') index = data['banned'].index(userid) del data['banned'][index] #requests.post('https://blacklisted-db.nitrotypers.repl.co', data={'key': os.getenv('DB_KEY'), 'data': json.dumps(data)}) await dbclient.update_big_array(collection, 'banned', data) embed = Embed('Success!', f'Unbanned user <@{str(userid)}> from the bot!', 'white_check_mark') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️ \nBecome a premium 💠 member today!', 'https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif' ) else: embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️ \n Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) return await embed.send(ctx)
def get_page(self, page_number, ctx, data, dbdata=None): n = page_number embed = Embed( ':shopping_cart: Shop', f'*{str(ctx.author)} entered the shop.* \nBuy epic stuff to enjoy the bot even more!' ) if n == 0: try: embed.field('Currently equipped', f'__Name:__ `{dbdata["equipped"]["car"]}`') embed.image( f'https://www.nitrotype.com/cars/{dbdata["equipped"]["img"]}' ) except: embed.field('Currently equipped', 'None') embed.field( 'Buy / equip items', 'Use `n.buy [Item ID]` to buy an item and `n.equip [Item ID]` to equip an item' ) embed.field( 'Reward', 'Equip your cars and get epic multipliers in the economy category!' ) embed.footer('Get amazing perks with items!') return embed if n == 1: f = open('weeklyupdate.txt') timeleft = int(f.readlines()[0]) - round(time.time()) embed.field( 'Weekly Items:', f'__Name:__ `{data["weekly"]["car"]}`\n__Price:__ `{str(data["weekly"]["price"])}` Lacans\n__Time left:__ `{self.format_time(timeleft)}` hours' ) embed.footer('Get amazing perks with items!') embed.image( f'https://www.nitrotype.com/cars/{data["weekly"]["img"]}') return embed if n == 2: f = open('dailyupdate.txt') timeleft = int(f.readlines()[0]) - round(time.time()) embed.field( 'Daily Items:', f'__Name:__ `{data["daily"]["car"]}`\n__Price:__ `{str(data["daily"]["price"])}` Lacans\n__Time left:__ `{self.format_time(timeleft)}` hours' ) embed.footer('Get amazing perks with items!') embed.image( f'https://www.nitrotype.com/cars/{data["daily"]["img"]}') return embed
async def numroles(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if (ctx.author.id) not in [505338178287173642, 396075607420567552]: embed = Embed( 'Error!', 'You\'re not a developer of this bot! Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( f'⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) return await embed.send(ctx) embed = Embed( 'Success!', f'The roles for `{str(ctx.author.guild.id)}` were created by ' + str(ctx.author.name + '#' + ctx.author.discriminator) + '.\n\n**Type:** __Racecount Roles__', 'white_check_mark') embed.footer( f'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot.\n⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) guild = ctx.guild await embed.send(ctx) await guild.create_role(name="Gold Member", colour=discord.Colour(0xFFFF00)) await guild.create_role(name="Registered") await guild.create_role(name=">99% Accuracy") await guild.create_role(name="99% Accuracy") await guild.create_role(name="98% Accuracy") await guild.create_role(name="97% Accuracy") await guild.create_role(name="96% Accuracy") await guild.create_role(name="94-95% Accuracy") await guild.create_role(name="90-93% Accuracy") await guild.create_role(name="87-89% Accuracy") await guild.create_role(name="84-86% Accuracy") await guild.create_role(name="80-83% Accuracy") await guild.create_role(name="75-79% Accuracy") await guild.create_role(name="<75% Accuracy") await guild.create_role(name="220+ WPM") await guild.create_role(name="210-219 WPM") await guild.create_role(name="200-209 WPM") await guild.create_role(name="190-199 WPM") await guild.create_role(name="180-189 WPM") await guild.create_role(name="170-179 WPM") await guild.create_role(name="160-169 WPM") await guild.create_role(name="150-159 WPM") await guild.create_role(name="140-149 WPM") await guild.create_role(name="130-139 WPM") await guild.create_role(name="120-129 WPM") await guild.create_role(name="110-119 WPM") await guild.create_role(name="100-109 WPM") await guild.create_role(name="90-99 WPM") await guild.create_role(name="80-89 WPM") await guild.create_role(name="70-79 WPM") await guild.create_role(name="60-69 WPM") await guild.create_role(name="50-59 WPM") await guild.create_role(name="40-49 WPM") await guild.create_role(name="30-39 WPM") await guild.create_role(name="20-29 WPM") await guild.create_role(name="10-19 WPM") await guild.create_role(name="1-9 WPM") await guild.create_role(name="500000+ Races") await guild.create_role(name="250000-499999 Races") await guild.create_role(name="200000-249999 Races") await guild.create_role(name="150000-199999 Races") await guild.create_role(name="100000-149999 Races") await guild.create_role(name="75000-99999 Races") await guild.create_role(name="50000-74999 Races") await guild.create_role(name="40000-49999 Races") await guild.create_role(name="30000-39999 Races") await guild.create_role(name="20000-29999 Races") await guild.create_role(name="10000-19999 Races") await guild.create_role(name="5000-9999 Races") await guild.create_role(name="3000-4999 Races") await guild.create_role(name="1000-2999 Races") await guild.create_role(name="500-999 Races") await guild.create_role(name="100-499 Races") await guild.create_role(name="50-99 Races") await guild.create_role(name="1-49 Races")
async def devunregister(self, ctx, discordid): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') dbkey = os.getenv('DB_KEY') #dbdata = json.loads(requests.get('https://test-db.nitrotypers.repl.co', data={"key": dbkey}).text) dbclient = DBClient() collection = dbclient.db.NT_to_discord for role in ctx.author.roles: if role.id in [ #Insert permitted role IDs here #SSH Administrator 788549177545588796, #SSH Moderator 788549154560671755, #SSH Server Support 788549207149248562 ]: bypass = True break else: bypass = False if (ctx.author.id) not in [ #Try2Win4Glory 505338178287173642, 396075607420567552 ] and not bypass: embed = Embed( 'Error!', 'Lol, did you really think it\'s possible for you to unregister a user when you are not a dev? Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) await embed.send(ctx) return premiumserver = False pcollection = dbclient.db.premium pdata = await dbclient.get_big_array(pcollection, 'premium') discordid0 = discordid.replace("<@!", "") discordid1 = discordid0.replace(">", "") success, userid = await get_username(discordid, get_id=True) if success: user = await ctx.guild.fetch_member(userid) else: user = await ctx.guild.fetch_member(discordid) discordid1 = user.id dbdata = await dbclient.get_array(collection, {'userID': str(discordid1)}) for x in pdata['premium']: if x['serverID'] == str(ctx.author.guild.id): premiumserver = True break async for x in dbdata: await collection.delete_one(x) #--Success Embed--# embed = Embed( 'Success!', 'Unregistered discord user <@' + str(discordid1) + '>!', 'white_check_mark') #--Footer--# if (ctx.author.id) in [ 396075607420567552, 505338178287173642, 637638904513691658 ]: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \n⚙️This command is a 🛠️developer🛠️ and verified helper only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a verified helper of this bot. \n⚙️This command is a 🛠️developer🛠️ and ✅ verified helper only command.⚙️', 'https://cdn.discordapp.com/attachments/765547632072196116/781838805044166676/output-onlinepngtools6.png' ) try: await ctx.message.delete() except: pass await embed.send(ctx) break #return #Remove roles if the server is premium: try: thelistofroles = [ "Gold Member", [ ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy" ], [ "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM" ], [ "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] ] listofroles = [ "Gold Member", ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy", "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM", "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] achievementroles = [ '"I < 3 Typing"', '"I Really Love Typing!"', '"Bonkers About Typing"', '"Bananas About Typing"', '"You\'ve Gotta Be Kidding"', '"Corsair"', '"Pirc"', '"Carrie"', '"Anne"', '"Lackin\' Nothin\'"', '"Outback Officer"', '"I Love Shoes 2"', '"I Love Shoes 12.5"', '"I Love Shoes 15.0"', '"I Love Shoes 20.0"', '"The Wildest of Flowers"', '"The Wild Legend"' ] teamswithroles = [ # Insert Global Team Tags Here ] #Team N8TE | Server Owner: 630761745140547625 if ctx.guild.id in [636582509429260289]: teamswithroles.append('[N8TE]') #Team DRPT | Server Owner: 723224207651111003 if ctx.guild.id in [742854336618561608]: teamswithroles.append('[DRPT]') #Team RRN | Server Owner: 653772108815532053 if ctx.guild.id in [696055942055198760]: teamswithroles.append('[RRN]') #Team NEWS | Server Owner: 272370019894165505 if ctx.guild.id in [835305919679692850]: teamswithroles.append('[NEWS]') #Team TEST | Server Owner: 505338178287173642 if ctx.guild.id in [833317505888026644]: teamswithroles.append('[TEST]') #Team TBZ | Server Owner: 657296213087092756 if ctx.guild.id in [857697272317345792]: teamswithroles.append('[TBZ]') #Team SSH | Server Owner: 363082908270985217 if ctx.guild.id in [788547373701136425]: teamswithroles.append('[SSH]') #Team NYM | Server Owner: 714147755974721556 if ctx.guild.id in [860954147342909440]: teamswithroles.append('[NYM]') registered = ['Registered'] roles_to_remove = [] try: success, userid = await get_username(discordid, get_id=True) if success: user = await ctx.guild.fetch_member(userid) else: user = await ctx.guild.fetch_member(discordid) except: user = await ctx.guild.fetch_member(discordid) for role in (user.roles): name = role.name if name in thelistofroles or name in teamswithroles or name in achievementroles: print('devunregister roles in user roles') role = get(ctx.message.guild.roles, id=role.id) roles_to_remove.append(role) try: role = get(ctx.message.guild.roles, name='Registered') roles_to_remove.append(role) role = get(ctx.message.guild.roles, name='Unregistered') roles_to_remove.append(role) except: pass await user.remove_roles(*roles_to_remove) except: pass
async def cash(self, ctx, placement=None, accuracy=None, session=None, friends=None, gold=None, wampus=None): # Print the values print(placement) print(accuracy) print(session) print(friends) print(wampus) print(gold) # Check if enough parameters entered if placement == None or accuracy == None or session == None or friends == None or gold == None: embed = Embed( 'Error!', 'Missing some required parameters. Please try again!\n`n.cash <placement> <accuracy> <session> <friends> <gold> <wampus>`\nIn case you are a non gold member, use `False` for the gold variable, otherwise use `True`. The `wampus` parameter is optional, only append it if you raced the wampus.\n__Example:__\n`n.cash 1 100 10 0 True Wampus` calculates the cash you receive with following requirements:\n- You placed **1st**.\n- Your rounded accuracy was **100%**.\n- Your had an ongoing session of **10** races.\n- You have Nitro Type Gold membership. \n- You raced with **0** friends. \n- You raced the **Wampus**.', 'warning') embed.footer('Do NOT include the <>!') return await embed.send(ctx) # Enough Parameters were entered else: # Define parameters as numbers try: numplacement = int(placement) try: numaccuracy = int(accuracy) round(numaccuracy, 0) except: numaccuracy = int(accuracy) numsession = int(session) if friends != None: try: numfriends = int(friends) except: numfriends = 0 if wampus != None: try: numwampus = int(wampus) except: numwampus = 0 # No numbers entered except: embed = Embed( 'Error!', 'Make sure to use numbers for the parameters `placement`, `accuracy`, `session` and `friends`, `True` or `False` for gold status and append `Wampus` in case you met the wampus.', 'warning') return await embed.send(ctx) # Optional Wampus Option Amount wampustrue = ['True', 'true', 'yes', 'Yes', 'wampus', 'Wampus'] if wampus in wampustrue: wampusvalue = 50000 else: wampusvalue = 0 # Calculate Friends Amount if numfriends <= 4 and numfriends >= 0: if numfriends == 0: friendsvalue = 0 elif numfriends == 1: friendsvalue = 50 elif numfriends == 2: friendsvalue == 100 elif numfriends == 3: friendsvalue = 150 elif numfriends == 4: friendsvalue = 200 else: embed = Embed('Error!', 'Make sure to use a valid friends number!', 'warning') return await embed.send(ctx) # Calculate Placement Amount if numplacement <= 5 and numplacement >= 1: if numplacement == 1: placementvalue = 2200 elif numplacement == 2: placementvalue = 2090 elif numplacement == 3: placementvalue = 1980 elif numplacement == 4: placementvalue = 1870 elif numplacement == 5: placementvalue = 1760 print(placementvalue) else: embed = Embed( 'Error!', 'Make sure to use a correct placement, ranging from `1` to `5`.', 'warning') return await embed.send(ctx) if numaccuracy <= 100 and numaccuracy >= 0: if numaccuracy == 100: accuracyvalue = 250 elif numaccuracy == 99: accuracyvalue = 150 elif numaccuracy == 98: accuracyvalue = 100 elif numaccuracy == 97: accuracyvalue = 50 elif numaccuracy < 97 and numaccuracy >= 0: accuracyvalue = 0 print(accuracyvalue) else: embed = Embed( 'Error!', 'Seems like you entered an invalid accuracy! Make sure to use **whole**, **rounded** numbers.', 'warning') return await embed.send(ctx) if numsession > 0: if numsession < 100 and numsession >= 10: sessionvalue = numsession * 10 elif numsession < 10: sessionvalue = 0 elif numsession >= 100: sessionvalue = 1000 print(sessionvalue) goldlisttrue = ['True', 'true', 'yes', 'Yes'] goldlistfalse = ['False', 'false', 'no', 'No'] try: if gold in goldlisttrue and wampus == None: goldvalue = (placementvalue + accuracyvalue + sessionvalue + friendsvalue) * 0.2 elif gold in goldlisttrue and wampusvalue != None: goldvalue = (placementvalue + accuracyvalue + sessionvalue + friendsvalue + wampusvalue) * 0.2 elif gold in goldlistfalse: goldvalue = 0 try: round(goldvalue, 0) except: pass print(goldvalue) except: embed = Embed( 'Your gold parameter was an invalid response! Make sure to either use `True` or `False`.', 'warning') return await embed.send(ctx) cashtotal = placementvalue + accuracyvalue + sessionvalue + friendsvalue + wampusvalue + goldvalue try: round(cashtotal, 0) except: pass print(cashtotal) # Add visual commands numplacement = "{:,}".format(numplacement) numaccuracy = "{:,}".format(numaccuracy) numsession = "{:,}".format(numsession) numfriends = "{:,}".format(numfriends) placementvalue = "{:,}".format(placementvalue) accuracyvalue = "{:,}".format(accuracyvalue) sessionvalue = "{:,}".format(sessionvalue) friendsvalue = "{:,}".format(friendsvalue) wampusvalue = "{:,}".format(wampusvalue) #goldvalue = goldvalue.replace('.0', '') round(int(goldvalue)) goldvalue = "{:,}".format(goldvalue) #cashtotal = cashtotal.replace('.0', '') round(int(cashtotal)) cashtotal = "{:,}".format(cashtotal) # Calculate Embed if wampus == None: embed = Embed( 'Your Cash Rewards', f'__Placement:__ {numplacement} (+ $**{placementvalue}**)\n__Accuracy:__ {numaccuracy}% (+ $**{accuracyvalue}**) \n__Session:__ {numsession} (+ $**{sessionvalue}**) \n__Friends:__ {numfriends} (+ $**{friendsvalue}**) \n__Gold:__ {gold} (+ $**{goldvalue}**) \n\n__Total:__ $**{cashtotal}**', 'coin') return await embed.send(ctx) elif wampus != None: embed = Embed( 'Your Cash Rewards', f'__Placement:__ {numplacement} (+ $**{placementvalue}**)\n__Accuracy:__ {numaccuracy}% (+ $**{accuracyvalue}**) \n__Session:__ {numsession} (+ $**{sessionvalue}**) \n__Friends:__ {numfriends} (+ $**{friendsvalue}**) \n__Wampus:__ {numwampus} (+ $**{wampusvalue}**)\n__Gold:__ {gold} (+ $**{goldvalue}**) \n\n__Total:__ $**{cashtotal}**', 'coin') return await embed.send(ctx)
async def giveaway(self, ctx): role1 = get(ctx.message.guild.roles, name='Giveaways') for role in ctx.author.roles: if role.name.lower() == "giveaways": has_perm = True break #else: #has_perm = False #if has_perm == False: #pass if ctx.author.guild_permissions.manage_guild: has_perm = True elif ctx.author.guild_permissions.administrator: has_perm = True elif ctx.author.id in [505338178287173642]: has_perm = True elif role.name.lower() == "giveaways": has_perm = True else: has_perm = False if has_perm == False: pass print(has_perm) if has_perm == False: embed = Embed( ':warning: Error!', 'Seems like you don\'t have the permission to use this command.\n\nThis command requires a role called `Giveaways`.' ) return await embed.send(ctx) embed = Embed( ':partying_face: Create A Giveaway: Step 1 - Channel :partying_face:', 'In what channel do you want the giveaway to be hosted?', color=0x00FF00) embed.field( '__Instructions:__', 'Type in a channel ID or mention of the channel where the giveaway should be hosted!\n\n*Example response: **#giveaways***' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] if ''.join(list(msg.content)[:2]) == "<#": channel = ''.join(list(msg.content)[2:-1]) elif list(msg.content)[:2] == "<!#": channel = ''.join(list(msg.content)[3:-1]) elif msg.content.isdigit(): channel = msg.content else: embed = Embed(':warning: Error!', 'You didn\'t give a valid channel ID or mention!') return await embed.send(ctx) embed = Embed( ':partying_face: Create A Giveaway: Step 2 - Duration :partying_face:', 'How Long Is Your Giveaway going to last?', color=0x00FF00) embed.field( '__Instructions:__', 'Use `s` for seconds, `m` for minutes, `h` for hours and `d` for days.\n\n*Example response: **1d***' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] msg = msg.content if len(msg.split('s')) == 2: msg = msg.split('s') if not msg[0].isdigit(): embed = Embed(':warning: Error!', 'Invalid amount of time!') return await embed.send(ctx) gwtime = ('seconds', int(msg[0])) elif len(msg.split('m')) == 2: msg = msg.split('m') if not msg[0].isdigit(): embed = Embed(':warning: Error!', 'Invalid amount of time!') return await embed.send(ctx) gwtime = ('minutes', int(msg[0])) elif len(msg.split('h')) == 2: msg = msg.split('h') if not msg[0].isdigit(): embed = Embed(':warning: Error!', 'Invalid amount of time!') return await embed.send(ctx) gwtime = ('hours', int(msg[0])) elif len(msg.split('d')) == 2: msg = msg.split('d') if not msg[0].isdigit(): embed = Embed(':warning: Error!', 'Invalid amount of time!') return await embed.send(ctx) gwtime = ('days', int(msg[0])) else: embed = Embed(':warning: Error!', 'You didn\'t give a valid amount of time!') return await embed.send(ctx) embed = Embed( ':partying_face: Create A Giveaway: Step 3 - Winners :partying_face:', 'How Many Winners should this giveaway have?', color=0x00FF00) embed.field( '__Instructions:__', 'Reply with the amount of winners you wish this giveaway to have.\n\n*Example response: **1***' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] msg = msg.content if msg.isdigit: winners = msg else: embed = Embed(':warning: Error!', 'You didn\'t give a valid number of winners!') return await embed.send(ctx) embed = Embed( ':partying_face: Create A Giveaway: Step 4 - Prize :partying_face:', 'What should the prize of this giveaway be?', color=0x00FF00) embed.field( '__Instructions:__', 'What are you giving away?\n\n*Example response: **100K NT cash ~courtesy of ⚡Try2Win4Glory⚡***' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] prize = msg.content embed = Embed( ':partying_face: Create A Giveaway: Step 5 - Requirements :partying_face:', 'Should this giveaway have requirements?', color=0x00FF00) embed.field( '__Instructions:__', 'Reply with `y` if you want to include requirements, reply with `n` if you\'d like to start the giveaway without requirements\n\n*Example response: **y***' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] requirements = {} if msg.content.lower() in ['y', 'n']: if msg.content.lower() in ['y']: while True: embed = Embed( ':partying_face: Create A Giveaway: Step 5 - Requirements :partying_face:', 'What type of requirement do you want?', color=0x00FF00) embed.field( '__Instructions:__', 'You can have `team` and `membership` requirements currently! Type one of them in! Type `none` to create the giveaway!' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] if msg.content.lower() == "team": embed = Embed( ':partying_face: Create A Giveaway: Step 5 - Requirements :partying_face:', 'What team does the user have to be in?', color=0x00FF00) embed.field( '__Instructions:__', 'Give a valid team name or team tag here!') await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] team = await Team(msg.content) if team.data == {}: embed = Embed('Invalid Team!', 'Oops you messed up!') await embed.send(ctx) continue else: requirements.update({"team": msg.content}) continue if msg.content.lower() == "membership": embed = Embed( ':partying_face: Create A Giveaway: Step 5 - Requirements :partying_face:', 'What type of membership does a person have to have?', color=0x00FF00) embed.field( '__Instructions:__', 'Type `gold` or `basic`, depending on the membership the users needs to have.' ) await embed.send(ctx) msg = await self.wait_for_msg(ctx) if msg[0] == False: return msg[1].send(ctx) else: msg = msg[1] if msg.content.lower() == "gold": requirements.update({"membership": "gold"}) if msg.content.lower() == "basic": requirements.update({"membership": "basic"}) else: embed = Embed('Invalid Membership', 'Oops you messed up!') await embed.send(ctx) continue if msg.content.lower() == "none": break else: if msg.content in ['n']: pass embed = Embed( ':white_check_mark: Success!', f'You\'ve created a giveaway that will be hosted in channel <#{str(channel)}>, lasts **{gwtime[1]}** **{gwtime[0]}**, has **{winners}** winners, and you\'re giving away **{prize}**', color=0x00FF00) await embed.send(ctx) addedtime = 0 if gwtime[0] == "seconds": addedtime = gwtime[1] elif gwtime[0] == "minutes": addedtime = 60 * gwtime[1] elif gwtime[0] == "hours": addedtime = 60 * 60 * gwtime[1] elif gwtime[0] == "days": addedtime = 24 * 60 * 60 * gwtime[1] if requirements == {}: reqs = 'none' else: reqs = ''.join(list(str(requirements))[1:-1]) try: list_of_lacans = [ '<:lacan_economy_1:801006407536607262>', '<:lacan_economy_2:801004873612132382>', '<:lacan_economy_3:801004873214722079>', '<:lacan_economy_4:801004868126113822>', '<:lacan_economy_5:801004868348936203>', '<:lacan_economy_6:801004863433605160>', '<:lacan_economy_7:801004870643220481>', '<:lacan_economy_8:801004872820457483>', '<:lacan_economy_9:801004872417804298>', '<:lacan_economy_10:801004872811413514>' ] random_lacan = random.choice(list_of_lacans) embed = Embed( ':tada: Giveaway :tada:', f'\n\n**Entry:** React with {random_lacan}!\n\n**Prize:** {prize}\n\n**Winners:** {winners}\n\n**Hosted by:** {ctx.author.mention}', timestamp=(datetime.fromtimestamp( int( int(datetime.timestamp(datetime.now())) + addedtime))), color=0x00FF00) '''embed.field('Prize', gwcontent) embed.field('Winners', winners) embed.field('To Enter', f'React With {random_lacan} !')''' embed.field('Requirements', reqs) embed.footer('Ends at') c = discord.utils.get(ctx.guild.channels, id=int(channel)) '''message = await c.send(content=":partying_face:", embed=embed.default_embed())''' message = await c.send(embed=embed.default_embed()) await message.add_reaction(random_lacan) except: embed = Embed( ':tada: Giveaway :tada:', f'\n\n**Entry:** React with :moneybag:!\n\n**Prize:** {prize}\n\n**Winners:** {winners}\n\n**Hosted by:** {ctx.author.mention}', timestamp=(datetime.fromtimestamp( int( int(datetime.timestamp(datetime.now())) + addedtime))), color=0x00FF00) '''embed.field('Prize', prize) embed.field('Winners', winners) embed.field('To Enter', 'React With :moneybag: !')''' embed.field('Requirements', reqs) embed.footer('Ends at') c = discord.utils.get(ctx.guild.channels, id=int(channel)) message = await c.send( content= "I am missing `Use external emoji` permissions. Make sure to give me those in order to enjoy giveaways even more!", embed=embed.default_embed()) #message = await c.send(embed=embed.default_embed()) await message.add_reaction('💰') dbclient = DBClient() collection = dbclient.db.giveaways await dbclient.create_doc( collection, { "endtime": int(int(datetime.timestamp(datetime.now())) + addedtime), "messageID": message.id, "channelID": message.channel.id, "ended": False, "requirements": requirements, "gwcontent": prize, "winners": winners }) print('gw in db') else: embed = Embed( 'Error!' 'You gave an invalid response! Your giveaway has been canceled.' ) return await embed.send(ctx)
async def kotrroles(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') if (ctx.author.id) not in [505338178287173642, 396075607420567552]: embed = Embed( 'Error!', 'You\'re not a developer of this bot! Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( f'⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) return await embed.send(ctx) embed = Embed( 'Success!', f'The roles for `{str(ctx.author.guild.id)}` were created by ' + str(ctx.author.name + '#' + ctx.author.discriminator) + '.\n\n**Type:** King of the Race roles', 'white_check_mark') embed.footer( f'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot.\n⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) guild = ctx.guild await embed.send(ctx) await guild.create_role(name="Gold Member", colour=discord.Colour(0xFFFF00)) await guild.create_role(name="Registered") await guild.create_role(name=">99% Accuracy") await guild.create_role(name="99% Accuracy") await guild.create_role(name="98% Accuracy") await guild.create_role(name="97% Accuracy") await guild.create_role(name="96% Accuracy") await guild.create_role(name="94-95% Accuracy") await guild.create_role(name="90-93% Accuracy") await guild.create_role(name="87-89% Accuracy") await guild.create_role(name="84-86% Accuracy") await guild.create_role(name="80-83% Accuracy") await guild.create_role(name="75-79% Accuracy") await guild.create_role(name="<75% Accuracy") await guild.create_role(name="220+ WPM") await guild.create_role(name="210-219 WPM") await guild.create_role(name="200-209 WPM") await guild.create_role(name="190-199 WPM") await guild.create_role(name="180-189 WPM") await guild.create_role(name="170-179 WPM") await guild.create_role(name="160-169 WPM") await guild.create_role(name="150-159 WPM") await guild.create_role(name="140-149 WPM") await guild.create_role(name="130-139 WPM") await guild.create_role(name="120-129 WPM") await guild.create_role(name="110-119 WPM") await guild.create_role(name="100-109 WPM") await guild.create_role(name="90-99 WPM") await guild.create_role(name="80-89 WPM") await guild.create_role(name="70-79 WPM") await guild.create_role(name="60-69 WPM") await guild.create_role(name="50-59 WPM") await guild.create_role(name="40-49 WPM") await guild.create_role(name="30-39 WPM") await guild.create_role(name="20-29 WPM") await guild.create_role(name="10-19 WPM") await guild.create_role(name="1-9 WPM") otherraceroles = [ '"I < 3 Typing"', '"I Really Love Typing!"', '"Bonkers About Typing"', '"Bananas About Typing"', '"You\'ve Gotta Be Kidding"', '"Corsair"', '"Pirc"', '"Carrie"', '"Anne"', '"Lackin\' Nothin\'"', '"Outback Officer"', '"I Love Shoes 2"', '"I Love Shoes 12.5"', '"I Love Shoes 15.0"', '"I Love Shoes 20.0"', '"The Wildest of Flowers"', '"The Wild Legend"' ] await guild.create_role(name=otherraceroles[16]) await guild.create_role(name=otherraceroles[15]) await guild.create_role(name=otherraceroles[14]) await guild.create_role(name=otherraceroles[13]) await guild.create_role(name=otherraceroles[12]) await guild.create_role(name=otherraceroles[11]) await guild.create_role(name=otherraceroles[10]) await guild.create_role(name=otherraceroles[9]) await guild.create_role(name=otherraceroles[8]) await guild.create_role(name=otherraceroles[7]) await guild.create_role(name=otherraceroles[6]) await guild.create_role(name=otherraceroles[5]) await guild.create_role(name=otherraceroles[4]) await guild.create_role(name=otherraceroles[3]) await guild.create_role(name=otherraceroles[2]) await guild.create_role(name=otherraceroles[1]) await guild.create_role(name=otherraceroles[0])
async def update(self, ctx): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') #Define Time variables #Variables = date(year, month, day) d1 = date(2021, 4, 1) dcurrent = date.today() thelistofroles = [ "Gold Member", [ ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy" ], [ "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM" ], [ "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] ] listofroles = [ "Gold Member", ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy", "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM", "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] teamswithroles = [ # Insert Global Team Tags Here ] #Team N8TE | Server Owner: 630761745140547625 if ctx.guild.id in [636582509429260289]: teamswithroles.append('[N8TE]') #Team DRPT | Server Owner: 723224207651111003 if ctx.guild.id in [742854336618561608]: teamswithroles.append('[DRPT]') #Team RRN | Server Owner: 653772108815532053 if ctx.guild.id in [696055942055198760]: teamswithroles.append('[RRN]') #Team NEWS | Server Owner: 272370019894165505 if ctx.guild.id in [835305919679692850]: teamswithroles.append('[NEWS]') #Team TEST | Server Owner: 505338178287173642 if ctx.guild.id in [833317505888026644]: teamswithroles.append('[TEST]') #data = requests.get('https://test-db.nitrotypers.repl.co', data={"key": os.getenv('DB_KEY')}).text #data = json.loads(data) dbclient = DBClient() pcollection = dbclient.db.premium pdata = await dbclient.get_big_array(pcollection, 'premium') for server in pdata['premium']: if str(ctx.author.guild.id) == server['serverID']: break else: embed = Embed( 'Error!', 'Unfortunately, this isn\'t a premium server! Run `n.premium` to learn more about premium!', 'warning') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( 'Become a premium 💠 member today!', 'https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \n⚙️This command is a premium 💠 only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) return await embed.send(ctx) roles_to_remove = [] for role in (ctx.author.roles): name = role.name if name in listofroles or name in teamswithroles: role = get(ctx.message.guild.roles, id=role.id) roles_to_remove.append(role) await ctx.author.remove_roles(*roles_to_remove) success, ntuser = await get_username(str(ctx.author.id)) if success: pass else: embed = Embed('Error!', 'Doesn\'t seem like you\'re registered!', 'warning') return await embed.send(ctx) racer = ntuser if ctx.author.id in [505338178287173642]: roles_to_add = [] #T2W4G's Speed Role listofroles = thelistofroles[2] role = get(ctx.message.guild.roles, name=listofroles[12]) roles_to_add.append(role) #T2W4G's Accuracy Role listofroles = thelistofroles[1] role = get(ctx.message.guild.roles, name=listofroles[0]) roles_to_add.append(role) #T2W4G's Races Role listofroles = thelistofroles[3] role = get(ctx.message.guild.roles, name=listofroles[8]) roles_to_add.append(role) #T2W4G's Gold Member Role role = get(ctx.message.guild.roles, name="Gold Member") roles_to_add.append(role) #T2W4G's Registered Role role = get(ctx.message.guild.roles, name='Registered') roles_to_add.append(role) #await ctx.author.add_roles(roles_to_add) #Add role '''role = get(ctx.message.guild.roles, name='Moderator') await ctx.author.add_roles(role) #Remove role role = get(ctx.message.guild.roles, name='Admin') await ctx.author.remove_roles(role)''' #Remove Unregistered Role Try try: role = get(ctx.message.guild.roles, name='Unregistered') await ctx.author.remove_roles(role) except: pass #T2W4G's Edit Nickname Try try: #T2W4G's Edit Nickname Success await ctx.author.edit(nick='⚡Try2Win4Glory⚡') #T2W4G's Edit Nickname Success Embed embed = Embed( 'Success!', 'Developer ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' \'s roles were updated. :-)', 'white check mark') #T2W4G's Embed Send await embed.send(ctx) except Exception: #T2W4G's Edit Nickname Fail embed = Embed( 'Rip!', 'I don\'t have the `Manage Nickames` permission! \n\nI updated your roles, but am missing the permission to change your nickname. :grinning:', 'poop') #T2W4G's Embed Send await embed.send(ctx) '''if str(racer.tag) in teamswithroles: print('yessir') try: guild=ctx.author.guild role = get(ctx.message.guild.roles, name=f'{racer.tag}') await ctx.author.add_roles(role) print('pog') return except: guild=ctx.author.guild await guild.create_role(name=racer.tag) role = get(ctx.message.guild.roles, name=f'{racer.tag}') await ctx.author.add_roles(role) print('created') return else: #embed=Embed('Error!', 'Team tag: '+racer.tag+'', 'warning') #return await embed.send(ctx) pass''' return else: roles_to_add = [] role = get(ctx.message.guild.roles, name=racer.speed_role) roles_to_add.append(role) role = get(ctx.message.guild.roles, name=racer.accuracy_role) roles_to_add.append(role) role = get(ctx.message.guild.roles, name=racer.race_role) roles_to_add.append(role) if racer.membership == 'gold': role = get(ctx.message.guild.roles, name="Gold Member") roles_to_add.append(role) role = get(ctx.message.guild.roles, name='Registered') try: roles_to_add.append(role) except Exception: embed = Embed( 'Error!', 'The bot is not able to update your roles. Make sure I have the `Manage Roles` permission, am ranked higher than that roles and you did a season race yet.' ) await embed.send(ctx) #Teamroles if str(racer.tag) in teamswithroles: print('yessir') try: guild = ctx.author.guild role = get(ctx.message.guild.roles, name=f'{racer.tag}') roles_to_add.append(role) print('pog') except: guild = ctx.author.guild await guild.create_role(name=racer.tag) role = get(ctx.message.guild.roles, name=f'{racer.tag}') roles_to_add.append(role) print('created') else: #embed=Embed('Error!', 'Team tag: '+racer.tag+'', 'warning') #return await embed.send(ctx) pass await ctx.author.add_roles(*roles_to_add) try: role = get(ctx.message.guild.roles, name='Unregistered') await ctx.author.remove_roles(role) except: pass #Start of April Script if d1 == dcurrent: #The current date matches the specified date: print('Hehe april fools day') random_names = [ 'Huge Elephant', 'Slimy Snail', 'Fat Panda', 'April Cat', 'Silent Spy', 'Lacan NTSport Developer', '10FF better than NT?', 'April Joke', 'Joker Typer', 'Keyboard Pig', 'Typing Nerd', 'adl212 is cool', '⚡Try2Win4Glory⚡ is pog', 'Lacan = Best Car', 'I love Typerush.com!', 'Whining Dog', 'Potaytoes', 'Chicken Typer', 'Command Spammer', 'The one and only', 'I bot on NitroType!', 'Ban me plz!', 'Happy April fools day!' ] random_name = random.choice(random_names) try: await ctx.author.edit(nick='[APRIL] ' + random_name + '') embed = Embed( 'Success!', 'Successfully updated your roles and nickname!', 'white_check_mark') embed.footer('Happy April fools day! :-)') return await embed.send(ctx) except Exception: embed = Embed( 'Error!', 'The bot needs following permissions: `Manage Nicknames` \n \n **Note:** If you are the server owner or not ranked lower than my highest role, I won\'t be able to update your nickname, but I will update your roles. :grinning:', 'warning') embed.footer( 'This command is a premium 💠 only command. Run n.premium to learn more about premium.', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) return await embed.send(ctx) else: try: await ctx.author.edit(nick=racer.tag + ' ' + racer.name) except Exception: embed = Embed( 'Error!', 'The bot needs following permissions: `Manage Nicknames` \n \n **Note:** If you are the server owner or not ranked lower than my highest role, I won\'t be able to update your nickname, but I will update your roles. :grinning:', 'warning') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( 'This command is a premium 💠 only command. Run n.premium to learn more about premium.', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \nThis command is a premium 💠 only command.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) return await embed.send(ctx) embed = Embed('Success!', 'Successfully updated your roles and nickname!', 'white_check_mark') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( 'This command is a premium 💠 only command. Run n.premium to learn more about premium.', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \nThis command is a premium 💠 only command.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) await embed.send(ctx)
async def devupdate(self, ctx, userid): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') for role in ctx.author.roles: if role.id in [ #Insert permitted role IDs here ]: bypass = True break else: bypass = False if (ctx.author.id) not in [ #Try2Win4Glory 505338178287173642, #adl212 396075607420567552, #Nate Dogg 630761745140547625 ] and bypass == False: embed = Embed( 'Error!', 'Lol. Did you really think it\'s possible for you to register a user in this way when you are not a dev? Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) return await embed.send(ctx) else: pass thelistofroles = [ "Gold Member", [ ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy" ], [ "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM" ], [ "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] ] listofroles = [ "Gold Member", ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy", "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM", "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] teamswithroles = [ # Insert Global Team Tags Here ] #Team N8TE | Server Owner: 630761745140547625 if ctx.guild.id in [636582509429260289]: teamswithroles.append('[N8TE]') #Team DRPT | Server Owner: 723224207651111003 if ctx.guild.id in [742854336618561608]: teamswithroles.append('[DRPT]') #Team RRN | Server Owner: 653772108815532053 if ctx.guild.id in [696055942055198760]: teamswithroles.append('[RRN]') #Team NEWS | Server Owner: 272370019894165505 if ctx.guild.id in [835305919679692850]: teamswithroles.append('[NEWS]') #Team TEST | Server Owner: 505338178287173642 if ctx.guild.id in [833317505888026644]: teamswithroles.append('[TEST]') #data = requests.get('https://test-db.nitrotypers.repl.co', data={"key": os.getenv('DB_KEY')}).text #data = json.loads(data) dbclient = DBClient() pcollection = dbclient.db.premium pdata = await dbclient.get_big_array(pcollection, 'premium') for server in pdata['premium']: if str(ctx.author.guild.id) == server['serverID']: break else: embed = Embed( 'Error!', 'Unfortunately, this isn\'t a premium server! Run `n.premium` to learn more about premium!', 'warning') #if (ctx.author.id) not in [505338178287173642, 637638904513691658, 396075607420567552]: #embed.footer('Become a premium 💠 member today!', 'https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif') #else: #embed.footer('Discord user '+str(ctx.author.name + '#' + ctx.author.discriminator)+' is a 🛠️developer🛠️ of this bot. \n⚙️This command is a premium 💠 only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png') return await embed.send(ctx) '''def remove_chars(data, chars): new_data = data for ch in chars: new_data = new_data.replace(ch, '') return new_data''' try: #Sent with ID user = await ctx.guild.fetch_member(userid) except: try: #Enable Mention Computer userid0 = userid.replace("<@!", "") userid1 = userid0.replace(">", "") print(userid) #Fetch User user = await ctx.guild.fetch_member(userid1) except: try: #Enable Mention Mobile userid0 = userid.replace("<@", "") userid1 = userid0.replace(">", "") print(userid) #Fetch User user = await ctx.guild.fetch_member(userid1) except: embed = Embed( 'Error!', 'I couldn\'t get the user you are trying to update!', 'warning') return await embed.send(ctx) for role in (user.roles): name = role.name if name in listofroles or name in teamswithroles: role = get(ctx.message.guild.roles, id=role.id) await user.remove_roles(role) try: role = get(ctx.message.guild.roles, name='Unregistered') await user.remove_roles(role) except: pass collection = dbclient.db.NT_to_discord data = await dbclient.get_array( collection, {'$and': [{ 'userID': str(user.id), 'verified': 'true' }]}) async for player in data: ntuser = player['NTuser'] break else: embed = Embed('Error!', 'Doesn\'t seem like ' + userid + ' is registered!', 'warning') return await embed.send(ctx) racer = await Racer(ntuser) if user.id in [505338178287173642]: #T2W4G's Speed Role listofroles = thelistofroles[2] role = get(ctx.message.guild.roles, name=listofroles[12]) await user.add_roles(role) #T2W4G's Accuracy Role listofroles = thelistofroles[1] role = get(ctx.message.guild.roles, name=listofroles[0]) await user.add_roles(role) #T2W4G's Races Role listofroles = thelistofroles[3] role = get(ctx.message.guild.roles, name=listofroles[8]) await user.add_roles(role) #T2W4G's Gold Member Role role = get(ctx.message.guild.roles, name="Gold Member") await user.add_roles(role) #T2W4G's Registered Role role = get(ctx.message.guild.roles, name='Registered') await user.add_roles(role) #Remove Unregistered Role Try try: role = get(ctx.message.guild.roles, name='Unregistered') await user.remove_roles(role) except: pass #T2W4G's Edit Nickname Try try: #T2W4G's Edit Nickname Success await user.edit(nick='⚡Try2Win4Glory⚡') #T2W4G's Edit Nickname Success Embed embed = Embed( 'Success!', 'Developer ' + str(user.name + '#' + user.discriminator) + ' \'s roles were updated. :-)', 'white check mark') #T2W4G's Embed Send await embed.send(ctx) except Exception: #T2W4G's Edit Nickname Fail embed = Embed( 'Rip!', 'I don\'t have the `Manage Nickames` permission! \n\nI updated your roles, but am missing the permission to change your nickname. :grinning:', 'poop') #T2W4G's Embed Send await embed.send(ctx) return else: wpm = int(racer.wpm_average) listofroles = thelistofroles[2] if wpm > 220: role = get(ctx.message.guild.roles, name=listofroles[0]) await user.add_roles(role) elif wpm > 210: role = get(ctx.message.guild.roles, name=listofroles[1]) await user.add_roles(role) elif wpm > 200: role = get(ctx.message.guild.roles, name=listofroles[2]) await user.add_roles(role) elif wpm > 190: role = get(ctx.message.guild.roles, name=listofroles[3]) await user.add_roles(role) elif wpm > 180: role = get(ctx.message.guild.roles, name=listofroles[4]) await user.add_roles(role) elif wpm > 170: role = get(ctx.message.guild.roles, name=listofroles[5]) await user.add_roles(role) elif wpm > 160: role = get(ctx.message.guild.roles, name=listofroles[6]) await user.add_roles(role) elif wpm > 150: role = get(ctx.message.guild.roles, name=listofroles[7]) await user.add_roles(role) elif wpm > 140: role = get(ctx.message.guild.roles, name=listofroles[8]) await user.add_roles(role) elif wpm > 130: role = get(ctx.message.guild.roles, name=listofroles[9]) await user.add_roles(role) elif wpm > 120: role = get(ctx.message.guild.roles, name=listofroles[10]) await user.add_roles(role) elif wpm > 110: role = get(ctx.message.guild.roles, name=listofroles[11]) await user.add_roles(role) elif wpm > 100: role = get(ctx.message.guild.roles, name=listofroles[12]) await user.add_roles(role) elif wpm > 90: role = get(ctx.message.guild.roles, name=listofroles[13]) await user.add_roles(role) elif wpm > 80: role = get(ctx.message.guild.roles, name=listofroles[14]) await user.add_roles(role) elif wpm > 70: role = get(ctx.message.guild.roles, name=listofroles[15]) await user.add_roles(role) elif wpm > 60: role = get(ctx.message.guild.roles, name=listofroles[16]) await user.add_roles(role) elif wpm > 50: role = get(ctx.message.guild.roles, name=listofroles[17]) await user.add_roles(role) elif wpm > 40: role = get(ctx.message.guild.roles, name=listofroles[18]) await user.add_roles(role) elif wpm > 30: role = get(ctx.message.guild.roles, name=listofroles[19]) await user.add_roles(role) elif wpm > 20: role = get(ctx.message.guild.roles, name=listofroles[20]) await user.add_roles(role) elif wpm > 10: role = get(ctx.message.guild.roles, name=listofroles[21]) await user.add_roles(role) elif wpm > 1: role = get(ctx.message.guild.roles, name=listofroles[22]) await user.add_roles(role) try: accuracy = int(round(racer.season_accuracy)) except: accuracy = int(round(racer.daily_accuracy)) listofroles = thelistofroles[1] if accuracy > 99: role = get(ctx.message.guild.roles, name=listofroles[0]) await user.add_roles(role) elif accuracy == 99: role = get(ctx.message.guild.roles, name=listofroles[1]) await user.add_roles(role) elif accuracy == 98: role = get(ctx.message.guild.roles, name=listofroles[2]) await user.add_roles(role) elif accuracy == 97: role = get(ctx.message.guild.roles, name=listofroles[3]) await user.add_roles(role) elif accuracy == 96: role = get(ctx.message.guild.roles, name=listofroles[4]) await user.add_roles(role) elif accuracy >= 94: role = get(ctx.message.guild.roles, name=listofroles[5]) await user.add_roles(role) elif accuracy >= 90: role = get(ctx.message.guild.roles, name=listofroles[6]) await user.add_roles(role) elif accuracy >= 87: role = get(ctx.message.guild.roles, name=listofroles[7]) await user.add_roles(role) elif accuracy >= 84: role = get(ctx.message.guild.roles, name=listofroles[8]) await user.add_roles(role) elif accuracy >= 80: role = get(ctx.message.guild.roles, name=listofroles[9]) await user.add_roles(role) elif accuracy > 75: role = get(ctx.message.guild.roles, name=listofroles[10]) await user.add_roles(role) else: role = get(ctx.message.guild.roles, name=listofroles[11]) await user.add_roles(role) races = int(racer.races.replace(',', '')) listofroles = thelistofroles[3] print(listofroles[13]) if int(races) > 500000: role = get(ctx.message.guild.roles, name=listofroles[0]) await user.add_roles(role) elif int(races) >= 250000: role = get(ctx.message.guild.roles, name=listofroles[1]) await user.add_roles(role) elif int(races) >= 200000: role = get(ctx.message.guild.roles, name=listofroles[2]) await user.add_roles(role) elif int(races) >= 150000: role = get(ctx.message.guild.roles, name=listofroles[3]) await user.add_roles(role) elif int(races) >= 100000: role = get(ctx.message.guild.roles, name=listofroles[4]) await user.add_roles(role) elif int(races) >= 75000: role = get(ctx.message.guild.roles, name=listofroles[5]) await user.add_roles(role) elif int(races) >= 50000: role = get(ctx.message.guild.roles, name=listofroles[6]) await user.add_roles(role) elif int(races) >= 40000: role = get(ctx.message.guild.roles, name=listofroles[7]) await user.add_roles(role) elif int(races) >= 30000: role = get(ctx.message.guild.roles, name=listofroles[8]) await user.add_roles(role) elif int(races) >= 20000: role = get(ctx.message.guild.roles, name=listofroles[9]) await user.add_roles(role) elif int(races) >= 10000: role = get(ctx.message.guild.roles, name=listofroles[10]) await user.add_roles(role) elif int(races) >= 5000: role = get(ctx.message.guild.roles, name=listofroles[11]) await user.add_roles(role) elif int(races) >= 3000: role = get(ctx.message.guild.roles, name=listofroles[12]) await user.add_roles(role) elif int(races) >= 1000: role = get(ctx.message.guild.roles, name=listofroles[13]) await user.add_roles(role) elif int(races) >= 500: role = get(ctx.message.guild.roles, name=listofroles[14]) await user.add_roles(role) elif int(races) >= 100: role = get(ctx.message.guild.roles, name=listofroles[15]) await user.add_roles(role) elif int(races) >= 50: role = get(ctx.message.guild.roles, name=listofroles[16]) await user.add_roles(role) elif int(races) >= 0: role = get(ctx.message.guild.roles, name=listofroles[17]) await user.add_roles(role) if racer.membership == 'gold': role = get(ctx.message.guild.roles, name="Gold Member") await user.add_roles(role) role = get(ctx.message.guild.roles, name='Registered') try: await user.add_roles(role) except Exception: embed = Embed( 'Error!', 'The bot is not able to update the roles of ' + user + '. Make sure I have the `Manage Roles` permission, am ranked higher than that roles and ' + user + ' did a season race yet.') await embed.send(ctx) #Teamroles if str(racer.tag) in teamswithroles: print('yessir') try: guild = ctx.author.guild role = get(ctx.message.guild.roles, name=f'{racer.tag}') await user.add_roles(role) print('pog') except: guild = ctx.author.guild await guild.create_role(name=racer.tag) role = get(ctx.message.guild.roles, name=f'{racer.tag}') await user.add_roles(role) print('created') else: #embed=Embed('Error!', 'Team tag: '+racer.tag+'', 'warning') #return await embed.send(ctx) pass try: role = get(ctx.message.guild.roles, name='Unregistered') await user.remove_roles(role) except: pass try: await user.edit(nick=racer.tag + ' ' + racer.name) except Exception: embed = Embed( 'Error!', 'The bot needs following permissions: `Manage Nicknames` \n \n **Note:** If ' + str(user) + ' is the server owner or not ranked lower than my highest role, I won\'t be able to update <@' + str(user.id) + '>\'s nickname, but I will update <@' + str(user.id) + '>\'s roles. :grinning:', 'warning') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( 'This command is a premium 💠 only command. Run n.premium to learn more about premium.', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \nThis command is a premium 💠 only command.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) return await embed.send(ctx) embed = Embed( 'Success!', 'Successfully updated <@' + str(user.id) + '>\'s roles and nickname!', 'white_check_mark') if (ctx.author.id) not in [ 505338178287173642, 637638904513691658, 396075607420567552 ]: embed.footer( 'This command is a premium 💠 only command. Run n.premium to learn more about premium.', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) else: embed.footer( 'Discord user ' + str(ctx.author) + ' is a 🛠️developer🛠️ of this bot. \nThis command is a premium 💠 only command.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) await embed.send(ctx)
async def devregister(self, ctx, discordid, ntuser): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') racer = await Racer(ntuser) if not racer.success: embed = Embed( 'Error!', 'Nitrotype user not found! Make sure to use `n.devregister <Mention / ID> <username>.', 'warning') return await embed.send(ctx) for role in ctx.author.roles: if role.id in [ #Insert permitted role IDs here ]: bypass = True break else: bypass = False if (ctx.author.id) not in [ #Try2Win4Glory 505338178287173642, #adl212 396075607420567552 ] and not bypass: embed = Embed( 'Error!', 'Lol. Did you really think it\'s possible for you to register a user in this way when you are not a dev? Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) return await embed.send(ctx) else: discordid0 = discordid.replace("<@!", "") discordid1 = discordid0.replace(">", "") print(discordid1) #data = json.loads(requests.get('https://test-db.nitrotypers.repl.co', data={"key": os.getenv('DB_KEY')}).text) dbclient = DBClient() collection = dbclient.db.NT_to_discord data = await dbclient.get_big_array(collection, 'registered') data['registered'].append({ "NTuser": ntuser, "userID": str(discordid1), "verified": "true" }) #requests.post('https://test-db.nitrotypers.repl.co', data={"key": os.getenv('DB_KEY'), "data": json.dumps(data)}) await dbclient.update_big_array(collection, 'registered', data) embed = Embed( 'Success!', f'<@{str(ctx.author.id)}> just connected discord user <@' + discordid1 + '> with NT username `' + ntuser + '`! \nIn case this is a premium :diamond_shape_with_a_dot_inside: server, <@' + discordid1 + '> needs to run `n.update` to update their roles.', 'white_check_mark') if (ctx.author.id) in [ 396075607420567552, 505338178287173642, 637638904513691658 ]: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \n⚙️This command is a 🛠️developer🛠️ and verified helper only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a verified helper of this bot. \n⚙️This command is a 🛠️developer🛠️ and ✅ verified helper only command.⚙️', 'https://cdn.discordapp.com/attachments/765547632072196116/781838805044166676/output-onlinepngtools6.png' ) await embed.send(ctx) try: await ctx.message.delete() except: pass
async def typerace(self, ctx): list_of_lacans = ['<:lacan_economy_1:801006407536607262>','<:lacan_economy_2:801004873612132382>','<:lacan_economy_3:801004873214722079>','<:lacan_economy_4:801004868126113822>','<:lacan_economy_5:801004868348936203>','<:lacan_economy_6:801004863433605160>','<:lacan_economy_7:801004870643220481>','<:lacan_economy_8:801004872820457483>','<:lacan_economy_9:801004872417804298>','<:lacan_economy_10:801004872811413514>'] random_lacan = random.choice(list_of_lacans) channels = self.client.get_all_channels() channel = get(channels, id=803879362226946088) green =0x40AC7B red = 0xE84444 orange = 0xF09F19 with open('text.txt') as f: sentences = f.readlines() t = random.choice(sentences).strip() start = random.randint(1, 5) end = random.randint(start+4, start+8) t = ' '.join(((base64.standard_b64decode(t)).decode().split())[start:end]) await self.create_image(t) embed = Embed("Type The Text!", "Type faster for bonus "+random_lacan+"!", "keyboard") #creates embed file = discord.File("text.png", filename="text.png") embed.image(url="attachment://text.png") await ctx.send(file=file, embed=embed.default_embed()) def check(message: discord.Message): return message.author.id == ctx.author.id start = round(time.time()) try: response = await self.client.wait_for('message', timeout=15, check=check) except asyncio.exceptions.TimeoutError: embed = Embed('<a:error:800338727645216779> Error!', 'You ran out of time because you took longer than `15` seconds to respond!') return await embed.send(ctx) list_of_lacans = ['<:lacan_economy_1:801006407536607262>','<:lacan_economy_2:801004873612132382>','<:lacan_economy_3:801004873214722079>','<:lacan_economy_4:801004868126113822>','<:lacan_economy_5:801004868348936203>','<:lacan_economy_6:801004863433605160>','<:lacan_economy_7:801004870643220481>','<:lacan_economy_8:801004872820457483>','<:lacan_economy_9:801004872417804298>','<:lacan_economy_10:801004872811413514>'] random_lacan = random.choice(list_of_lacans) channels = self.client.get_all_channels() channel = get(channels, id=803879362226946088) green =0x40AC7B red = 0xE84444 orange = 0xF09F19 if ctx.author.id not in [505338178287173642, 637638904513691658, 396075607420567552]: cooldown_add(str(ctx.author)) if response.content == t: data = json.loads(requests.get('https://lacanitemshop.nitrotypers.repl.co/data.json').text) shopcars = [data['daily']['img'], data['weekly']['img']] dbclient = DBClient() collection = dbclient.db.pointsdb data = await dbclient.get_array(collection, {'$and': [{'userid': str(ctx.author.id)}, {'userid': str(ctx.author.id)}]}) async for d in data: user = d break try: old = copy.deepcopy(user) for car in user['cars']: if user['equipped']['img'] in shopcars: carbonus = True break else: carbonus = False except: carbonus = False end = round(time.time()) total = end-start bonus = round(5/total) if carbonus: default = 3 earned = (default+bonus)*2 else: default = 3 earned = default+bonus embed = Embed('<a:Check:797009550003666955> Congrats!', f'You Earned {random_lacan}!') embed.field('Default', str(default)) embed.field('Bonus', str(bonus)) embed.field('Total', str(earned)) if carbonus: embed.field('Multiplier', 'X2') embed.footer('You earned double lacans by equipping the daily or weekly car!') await embed.send(ctx) try: if user['userid'] == str(ctx.author.id): user['points'] += earned await dbclient.update_array(collection, old, user) except UnboundLocalError: await dbclient.create_doc(collection, {'userid': str(ctx.author.id), 'points': earned}) else: embed = Embed('<a:false:800330847865143327> Oops!', 'You messed up sadly... and lost **3** '+random_lacan+'.') await embed.send(ctx) #Loose lacans dbclient = DBClient() collection = dbclient.db.pointsdb data = await dbclient.get_array(collection, {'$and': [{'userid': str(ctx.author.id)}, {'userid': str(ctx.author.id)}]}) lost = -3 async for d in data: user = d break try: old = user.copy() if user['userid'] == str(ctx.author.id): user['points'] += lost await dbclient.update_array(collection, old, user) else: await dbclient.create_doc(collection, {'userid': str(ctx.author.id), 'points': lost}) except UnboundLocalError: await dbclient.create_doc(collection, {'userid': str(ctx.author.id), 'points': lost}) return
async def stats(self, ctx, user=None): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') #data = json.loads(requests.get('https://test-db.nitrotypers.repl.co', data={'key': os.getenv('DB_KEY')}).text) if user == None: try: racer = await get_username(str(ctx.author.id)) except: embed=Embed('Error!', 'Couldn\'t find that user', 'warning') else: racer = await get_username(user, True) try: if racer[0] == True: racer = racer[1] else: return await racer[1].send(ctx) except: embed = Embed('Error!', 'Couldn\'t find that user', 'warning') return await embed.send(ctx) if racer.membership == 'basic': embed = Embed(f'{racer.username} ({racer.name})\'s stats', racer.tag_and_name, 'race car', 0xfc3503) embed.footer(f'{racer.name.title()} has a Standard account. \nThese stats are brought to you by adl212, Try2Win4Glory and Joshua_Kim.', 'https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif') if (ctx.author.id) not in []: embed.footer(f'{racer.name.title()} has a Standard account.\nThese stats are brought to you by adl212 and Try2Win4Glory','https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif') else: embed.footer('Discord user '+str(ctx.author.name + '#' + ctx.author.discriminator)+' is a developer of this bot.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png') elif racer.membership == 'gold': embed = Embed(f'{racer.username} ({racer.name})\'s stats', racer.tag_and_name, 'race car', 0xfac32d) embed.footer(f'{racer.name.title()} has a Gold account. \nThese stats are brought to you by adl212, Try2Win4Glory and Joshua_Kim.', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png') if (ctx.author.id) not in [505338178287173642, 637638904513691658, 396075607420567552]: embed.footer(f'{racer.name.title()} has a Gold account. Become a premium 💠member today! \nThese stats are brought to you by adl212 and Try2Win4Glory.','https://media.discordapp.net/attachments/719414661686099993/765110312482766919/NT_Server_Halloween_Logo_2020_GIF.gif') else: embed.footer('Discord user '+str(ctx.author.name + '#' + ctx.author.discriminator)+' is a developer of this bot.', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png') '''try: if racer.car == 'https://www.nitrotype.com/cars/17_large_1.png' and racer.car.id != '17': pass print(racer.car.name) else: embed.thumbnail(racer.car) print(racer.car.name) except: embed.thumbnail(racer.car)''' '''if racer.car == 'https://www.nitrotype.com/cars/110_large_1.png': print('Minnie the coper alarm') else:''' embed.thumbnail(racer.car) print(racer.name+' is from '+racer.country) embed.field('__General Info__', f':small_blue_diamond: Level: **{racer.level}**\n:small_blue_diamond: XP: **{racer.experience}** \n:small_blue_diamond: **{racer.country}**\n:eyes: **{racer.views}** \n :birthday: **{racer.created}**', inline=True) #Achievement points: **{racer.points}** #embed.field('\n\u200b', '\n\u200b') embed.field('__Speed__', f':stopwatch: Avg: **{racer.wpm_average}**\n:stopwatch: High: **{racer.wpm_high}**') #embed.field('\n\u200b', '\n\u200b') embed.field('__Races__', f':checkered_flag: **{racer.races}** \n:first_place: **{racer.first}** (**{racer.first_perc}%**)\n:second_place: **{racer.second}** (**{racer.second_perc}%**)\n:third_place: **{racer.third}** (**{racer.third_perc}%**)', inline=True) #embed.field('\n\u200b', '\n\u200b') embed.field('__Cars__', f':race_car: **{racer.cars_owned}** owned\n:race_car: **{racer.cars_sold}** sold\n:race_car: **{racer.cars_total}** total\n:race_car: **{racer.current_car}**') #embed.field('\n\u200b', '\n\u200b') embed.field('__Nitros__', f':zap: **{racer.nitros}** owned\n:zap: **{racer.nitros_used}** used\n:zap: **{racer.nitros_total}** total') #embed.field('\u200b', '\u200b') ''' embed.field('__Money__', f':dollar: **{racer.money}**\n:dollar: **{racer.money_spent}** spent\n:dollar: **{racer.money_total}** total') ''' try: embed.field('__Daily__', f':trophy: **{fn(racer.daily_races)}** races\n :trophy: **{fn(racer.daily_pre["errs"])}** errors \n :trophy: **{fn(racer.daily_pre["typed"])}** words\n :trophy: **{str(round(racer.daily_speed, 2))}** WPM\n :trophy: **{str(round(racer.daily_accuracy, 2))}**% acc') except: pass try: embed.field('__Season__', f':trophy: **{fn(racer.season_races)}** races\n :trophy: **{fn(racer.season_pre["errs"])}** errors \n :trophy: **{fn(racer.season_pre["typed"])}** words\n :trophy: **{str(round(racer.season_speed, 2))}** WPM\n :trophy: **{str(round(racer.season_accuracy, 2))}**% acc') except: pass embed.field('__Settings__', f':gear: Friends: {racer.friend_reqs_allowed}\n:gear: Team invite: {racer.looking_for_team}') await embed.send(ctx)
async def devunregister(self, ctx, discordid): #return await ctx.send('This command is currently under maintenance. The developers will try to get it up again as soon as possible. In the meantime feel free to use `n.help` to get the other commands. Thank you for your understanding!') dbkey = os.getenv('DB_KEY') #dbdata = json.loads(requests.get('https://test-db.nitrotypers.repl.co', data={"key": dbkey}).text) dbclient = DBClient() collection = dbclient.db.NT_to_discord for role in ctx.author.roles: if role.id in [ #Insert permitted role IDs here ]: bypass = True break else: bypass = False if (ctx.author.id) not in [ #Try2Win4Glory 505338178287173642, #adl212 396075607420567552 ] and not bypass: embed = Embed( 'Error!', 'Lol, did you really think it\'s possible for you to unregister a user when you are not a dev? Click [here](https://www.latlmes.com/entertainment/dev-application-1) to apply for dev.', 'warning') embed.footer( '⚙️This command is a 🛠️developer🛠️ only command.⚙️', 'https://cdn.discordapp.com/attachments/719414661686099993/754971786231283712/season-callout-badge.png' ) await embed.send(ctx) return premiumserver = False pcollection = dbclient.db.premium pdata = await dbclient.get_big_array(pcollection, 'premium') discordid0 = discordid.replace("<@!", "") discordid1 = discordid0.replace(">", "") dbdata = await dbclient.get_array(collection, {'userID': str(discordid1)}) for x in pdata['premium']: if x['serverID'] == str(ctx.author.guild.id): premiumserver = True break async for x in dbdata: await collection.delete_one(x) #--Success Embed--# embed = Embed('Success!', 'Unregistered discord user <@' + discordid1 + '>!', 'white_check_mark') #--Footer--# if (ctx.author.id) in [ 396075607420567552, 505338178287173642, 637638904513691658 ]: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a 🛠️developer🛠️ of this bot. \n⚙️This command is a 🛠️developer🛠️ and verified helper only command.⚙️', 'https://media.discordapp.net/attachments/719414661686099993/765490220858081280/output-onlinepngtools_32.png' ) else: embed.footer( 'Discord user ' + str(ctx.author.name + '#' + ctx.author.discriminator) + ' is a verified helper of this bot. \n⚙️This command is a 🛠️developer🛠️ and ✅ verified helper only command.⚙️', 'https://cdn.discordapp.com/attachments/765547632072196116/781838805044166676/output-onlinepngtools6.png' ) try: await ctx.message.delete() except: pass await embed.send(ctx) break #return #Remove roles if the server is premium: try: thelistofroles = [ "Gold Member", [ ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy" ], [ "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM" ], [ "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] ] listofroles = [ "Gold Member", ">99% Accuracy", "99% Accuracy", "98% Accuracy", "97% Accuracy", "96% Accuracy", "94-95% Accuracy", "90-93% Accuracy", "87-89% Accuracy", "84-86% Accuracy", "80-83% Accuracy", "75-79% Accuracy", "<75% Accuracy", "220+ WPM", "210-219 WPM", "200-209 WPM", "190-199 WPM", "180-189 WPM", "170-179 WPM", "160-169 WPM", "150-159 WPM", "140-149 WPM", "130-139 WPM", "120-129 WPM", "110-119 WPM", "100-109 WPM", "90-99 WPM", "80-89 WPM", "70-79 WPM", "60-69 WPM", "50-59 WPM", "40-49 WPM", "30-39 WPM", "20-29 WPM", "10-19 WPM", "1-9 WPM", "500000+ Races", "250000-499999 Races", "200000-249999 Races", "150000-199999 Races", "100000-149999 Races", "75000-99999 Races", "50000-74999 Races", "40000-49999 Races", "30000-39999 Races", "20000-29999 Races", "10000-19999 Races", "5000-9999 Races", "3000-4999 Races", "1000-2999 Races", "500-999 Races", "100-499 Races", "50-99 Races", "1-49 Races" ] teamswithroles = [ # Insert Global Team Tags Here ] #Team N8TE | Server Owner: 630761745140547625 if ctx.guild.id in [636582509429260289]: teamswithroles.append('[N8TE]') #Team DRPT | Server Owner: 723224207651111003 if ctx.guild.id in [742854336618561608]: teamswithroles.append('[DRPT]') #Team RRN | Server Owner: 653772108815532053 if ctx.guild.id in [696055942055198760]: teamswithroles.append('[RRN]') #Team NEWS | Server Owner: 272370019894165505 if ctx.guild.id in [835305919679692850]: teamswithroles.append('[NEWS]') #Team TEST | Server Owner: 505338178287173642 if ctx.guild.id in [833317505888026644]: teamswithroles.append('[TEST]') registered = ['Registered'] user = await ctx.guild.fetch_member(discordid) for role in (user.roles): name = role.name if name in listofroles or name in teamswithroles or name in registered: role = get(ctx.message.guild.roles, id=role.id) await user.remove_roles(role) try: role = get(ctx.message.guild.roles, name='Unregistered') await user.add_roles(role) except: pass except: pass