async def randomimgin(self, ctx, room_name): functions.log(ctx.guild.name, ctx.author, ctx.command) room = functions.get_room_json(room_name) if room: embed = discord.Embed( colour=discord.Colour.orange(), description= f"<a:spinning:804022054822346823> Loading >10,000 pictures taken in `^{room['Name']}`, and picking one randomly..." ) functions.embed_footer(ctx, embed) loading = await ctx.send(embed=embed) room_photos = functions.get_photos_in_room(room_name) if room_photos: random_photo = room_photos[random.randint( 0, len(room_photos) - 1)] embed = functions.image_embed(random_photo) else: embed = functions.error_msg( ctx, f"Not a single picture has been taken in `^{room['Name']}`" ) else: embed = functions.error_msg(ctx, f"Room `^{room_name}` doesn't exist!") await loading.delete() functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(f"Random image in `^{room['Name']}`", embed=embed)
async def fastrandombio(self, ctx, amount=1): functions.log(ctx.guild.name, ctx.author, ctx.command) if amount > 5: amount = 5 elif amount < 1: amount = 1 embed = discord.Embed( colour=discord.Colour.orange(), title="Random bio(s)", ) with open('randombio_list.json') as json_file: data = json.load(json_file) for x in range(amount): random_bio = random.randint(0, len(data) - 1) username = functions.id_to_username( data[random_bio]["account_id"]) display_name = functions.id_to_display_name( data[random_bio]["account_id"]) bio = data[random_bio]["bio"] embed.add_field( name=f"👤 **{display_name}** @{username}", value= f"```{bio}```[🔗Profile](https://rec.net/user/{username})", inline=False) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def randomaccount(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) account = functions.find_random_account() pfp = functions.id_to_pfp(account['accountId']) embed = discord.Embed( colour=discord.Colour.orange(), title=f"Random account! @{account['username']}", ) embed.add_field(name="Display name", value=f"`{account['displayName']}`", inline=True) embed.add_field(name="Created at", value=f"`{account['createdAt'][:10]}`", inline=True) embed.add_field(name="Is junior?", value=f"`{account['isJunior']}`", inline=True) embed.add_field( name="Bio", value=f"```{functions.id_to_bio(account['accountId'])}```") embed.set_image(url=pfp) embed.set_author(name=f"🔗 {account['username']}'s profile", url=f"https://rec.net/user/{account['username']}", icon_url=pfp) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def randomevent(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) event = functions.find_random_event() event_creator = functions.id_to_username(event['CreatorPlayerId']) event_description = event['Description'] try: event_room = f"[^{functions.get_room_json(event['RoomId'], True)['Name']}](https://rec.net/room/{functions.get_room_json(event['RoomId'], True)['Name']})" except: event_room = "`Dorm room`" if not event["Description"]: event_description = "None" embed = discord.Embed( colour=discord.Colour.orange(), title=f"{event['Name'] }", description= f"**Description**```{event_description}```\n**Information**\n🚪 Room: {event_room}\n👥 Attendees: `{event['AttendeeCount']}`\n📆 Start time: `{event['StartTime'][:10]}`, at ⏰ `{event['StartTime'][11:16]} UTC`\n🚷 End time: `{event['EndTime'][:10]}`, at ⏰ `{event['EndTime'][11:16]} UTC`", url=f"https://rec.net/event/{event['PlayerEventId']}") embed.set_author(name=f"🔗 {event_creator}'s profile", url=f"https://rec.net/user/{event_creator}", icon_url=functions.id_to_pfp( event['CreatorPlayerId'])) embed.set_image( url=f"https://img.rec.net/{event['ImageName']}?width=720") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def invite(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) embed=discord.Embed( colour=discord.Colour.orange(), title = "🔗 Invitation links!", description = "<:discord:803539862435135510> [Test server](https://discord.gg/GPVdhMa2zK)\n<:BotGraffiti:803539486930763786> [Bot invite link](https://discord.com/api/oauth2/authorize?client_id=788632031835324456&permissions=322624&scope=bot)" ) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def doc(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) embed=discord.Embed( colour=discord.Colour.orange(), title = "Unofficial documentation of RecNet API, made by ColinXYZ", description = "[Documentation Link](https://documenter.getpostman.com/view/13848200/TVt184DN)" ) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def send_initial_message(self, ctx, channel): reward_instance[self._author_id]['ctx'] = ctx embed = discord.Embed(colour=0x2f3136, title="Choose a reward!") rewards = reward_instance[self._author_id]['rewards'] for item in rewards: item_data = await get_item_data(item) stars = "\n" if item_data['category'] != "tokens": # Rarity string for i in range(item_data['rarity']): stars += "<:RRStar:825357537209090098> " if stars == "\n": stars = "" embed.add_field( name=f"{item_data['emoji_icon']} {item_data['name']}", value= f"<:RRtoken:825288414789107762> `{item_data['tokens']}`{stars}", inline=True) # embed.add_field(name="DEBUG", value=reward_instance.keys()) # embed.set_footer(text=f"Author id: {self._author_id}") box_img_url = "https://i.imgur.com/SBxexI1.png" embed.set_thumbnail(url=box_img_url) embed = functions.embed_footer(ctx, embed) return await channel.send(embed=embed)
async def randomroom(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) embed = discord.Embed( colour=discord.Colour.orange(), description= f"<a:spinning:804022054822346823> Searching for a random room...") functions.embed_footer(ctx, embed) loading = await ctx.send(embed=embed) room = functions.find_random_room() room_embed = functions.room_embed(room, True) functions.embed_footer(ctx, room_embed) # get default footer from function await loading.delete() await ctx.send(embed=room_embed)
async def randomimg(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) embed = discord.Embed( colour=discord.Colour.orange(), description= f"<a:spinning:804022054822346823> Searching for a random image...") functions.embed_footer(ctx, embed) loading = await ctx.send(embed=embed) random_img = functions.find_random_img() embed = functions.image_embed(random_img) await loading.delete() functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(f"Random image", embed=embed)
async def eventsearch(self, ctx, word): functions.log(ctx.guild.name, ctx.author, ctx.command) keyword = str(word) if len(keyword) < 2: embed = functions.error_msg( ctx, "Keyword must be at least 2 characters long!") await ctx.send(embed=embed) else: events_found = functions.event_search(keyword) embed = discord.Embed( colour=discord.Colour.orange(), title=f"Events found with keyword \"{keyword}\"", ) events = 0 if events_found: for event in events_found: if (functions.contains_word(event['Name'], keyword) or functions.contains_word(event['Description'], keyword)): description = event['Description'] if not description: description = "None" events += 1 embed.add_field( name=event['Name'], value= f"**[\"{event['Name']}\"](https://rec.net/event/{event['PlayerEventId']})** | [`{functions.id_to_display_name(event['CreatorPlayerId'])}`](https://rec.net/user/{functions.id_to_username(event['CreatorPlayerId'])})```{description}```👥 Attending: `{event['AttendeeCount']}`\n\n~~~~~~~~~~", inline=False) if not events: embed.add_field( name="None!", value= f"Couldn't find any event that contains the word `{keyword}`", inline=False) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def randomloadscreen(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) loading_screens = requests.get( "https://cdn.rec.net/config/LoadingScreenTipData").json() load_screen = loading_screens[random.randint(0, len(loading_screens) - 1)] embed = discord.Embed( colour=discord.Colour.orange(), title=load_screen["Title"], description= f"{load_screen['Message']}\n\n*Made in*\n📆 `{load_screen['CreatedAt'][:10]}`\n⏰ `{load_screen['CreatedAt'][11:16]} UTC`" ) embed.set_image( url=f"https://img.rec.net/{load_screen['ImageName']}?width=720") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def randomimgofin(self, ctx, profile, room_name): functions.log(ctx.guild.name, ctx.author, ctx.command) account = functions.check_account_existence_and_return(profile) if account: profile = account['username'] room = functions.get_room_json(room_name) if room: photos = functions.id_to_feed(account['account_id']) if photos: found_photos = [] # find photos in room for photo in photos: if photo['RoomId'] == room['RoomId']: found_photos.append(photo) if found_photos: random_photos = found_photos[random.randint( 0, len(found_photos) - 1)] embed = functions.image_embed(random_photos) else: embed = functions.error_msg( ctx, f"User `@{account['username']}` doesn't appear in `^{room['Name']}`!" ) else: embed = functions.error_msg( ctx, f"User `@{profile}` doesn't appear in `^{room_name}` at all!" ) else: embed = functions.error_msg( ctx, f"Room `^{room_name}` doesn't exist!") else: embed = functions.error_msg(ctx, f"User `@{profile}` doesn't exist!") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(f"Random image of `@{profile}`, in `^{room['Name']}`", embed=embed)
async def cringebio(self, ctx, amount=1): functions.log(ctx.guild.name, ctx.author, ctx.command) if amount > 5: amount = 5 elif amount < 1: amount = 1 bio_list = [] with open('cringe_bios.json') as data_file: cringe_bio_list = json.load(data_file) for x in range(amount): random_bio = cringe_bio_list[random.randint( 0, len(cringe_bio_list) - 1)] bio_list.append({ "account_id": random_bio[0], "bio": random_bio[1] }) embed = discord.Embed(colour=discord.Colour.orange(), title="Possible cringe bio(s)") # make fields for bios for bio in bio_list: account_id = bio["account_id"] username = functions.id_to_username(account_id) display_name = functions.id_to_display_name(account_id) bio = bio["bio"] embed.add_field( name=f"👤 **{display_name}** @{username}", value=f"```{bio}```[🔗Profile](https://rec.net/user/{username})", inline=False) embed.add_field(name="CHECK IF SOMEONE'S BIO IS CRINGE!", value=f"`.cbc <username>`", inline=False) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def randombio(self, ctx, amount=1): functions.log(ctx.guild.name, ctx.author, ctx.command) author = f"<@{ctx.author.id}>" if amount > 5: amount = 5 elif amount < 1: amount = 1 embed = discord.Embed( colour=discord.Colour.orange(), description= f"<a:spinning:804022054822346823> Searching for {amount} random bio(s)..." ) functions.embed_footer(ctx, embed) loading = await ctx.send(embed=embed) bio_list = [] for x in range(amount): bio = functions.find_random_bio() bio_list.append(bio) embed = discord.Embed(colour=discord.Colour.orange(), title="Random bio(s)") # make fields for bios for x in bio_list: account_id = x["account_id"] username = functions.id_to_username(account_id) display_name = functions.id_to_display_name(account_id) bio = x["bio"] embed.add_field( name=f"👤 {display_name} @{username}", value=f"```{bio}```[🔗Profile](https://rec.net/user/{username})", inline=False) functions.embed_footer(ctx, embed) # get default footer from function await loading.delete() await ctx.send(author, embed=embed)
async def randomimgof(self, ctx, profile): functions.log(ctx.guild.name, ctx.author, ctx.command) account = functions.check_account_existence_and_return(profile) if account: profile = account['username'] feed = functions.id_to_feed(account['account_id']) if feed: random_feed = feed[random.randint(0, len(feed) - 1)] embed = functions.image_embed(random_feed) else: embed = functions.error_msg( ctx, f"User `@{profile}` doesn't appear in any post!") else: embed = functions.error_msg(ctx, f"User `@{profile}` doesn't exist!") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(f"Random image of `@{profile}`", embed=embed)
async def set(self, ctx): commanders = get_commanders() embed = discord.Embed(title='', description='', color=ctx.author.color) embed.set_author(icon_url=ctx.author.avatar_url, name='Here you go:') message = '' for c in commanders: message += (str(await self.bot.fetch_user(c)) + ': ' + str(commanders[c]) + '\n') embed.add_field(name='Bot Commanders:', value=message) embed.set_footer(text=embed_footer(ctx.author)) await ctx.send(content=None, embed=embed) print(f'Auth All command used by {ctx.author} at {now()}')
async def randomimgby(self, ctx, profile): functions.log(ctx.guild.name, ctx.author, ctx.command) account = functions.check_account_existence_and_return(profile) if account: profile = account['username'] photos = functions.id_to_photos(account['account_id']) if photos: random_photos = photos[random.randint(0, len(photos) - 1)] embed = functions.image_embed(random_photos) else: embed = functions.error_msg( ctx, f"User `@{account['username']}` hasn't shared a single post!" ) else: embed = functions.error_msg(ctx, f"User `@{profile}` doesn't exist!") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(f"Random image by `@{profile}`", embed=embed)
async def randompfp(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) pfp = "DefaultProfileImage" while pfp == "DefaultProfileImage": account = functions.find_random_account() pfp = account["profileImage"] account_id = account["accountId"] username = account["username"] embed = discord.Embed( colour=discord.Colour.orange(), title="Random profile picture!", description= f"[🔗 RecNet post](https://rec.net/image/{pfp}) *(might not exist)*" ) embed.set_image(url=f"https://img.rec.net/{pfp}") embed.set_author(name=f"🔗 {username}'s profile", url=f"https://rec.net/user/{username}", icon_url=functions.id_to_pfp(account_id)) functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def check(self, ctx, user: discord.User = None, detail=''): if not user: user = ctx.author auth_level = get_commanders().get(str(user.id), default_auth) embed = discord.Embed(title='', description='', color=user.color) embed.set_author(icon_url=user.avatar_url, name=f'{user} is ' f'authorized at level {auth_level}') if detail != '': perms = '' for perm in sorted(perms_info.keys(), reverse=True): if perm <= auth_level: perms += str(perm) + ': ' + perms_info.get(perm) + '\n' embed.add_field(name='The Details:', value=perms) embed.set_footer(text=embed_footer(ctx.author)) await ctx.send(content=None, embed=embed, delete_after=deltime * 5) await ctx.message.delete(delay=deltime) # delete the command print( f'Auth check command used by {ctx.author} at {now()}, {user} is authorized at level {auth_level}.' )
async def check_permissions(self, ctx, member: discord.Member = None, detail=1): """Check the permissions of a user on the current server Member: The person who's perms to check Detail: 1 for significant perms, 2 for notable perms, 3 for all perms""" # assign caller of command if no one is chosen if not member: member = ctx.author # embed it embed = discord.Embed(title='', description='', color=member.color) embed.set_author(icon_url=member.avatar_url, name=f"{str(member)}'s perms on {ctx.guild.name}") if detail > 0: # include basic perms iperms = '\n'.join(perm for perm, value in member.guild_permissions if str(perm) in basicperms if value) if len(iperms) < 1: iperms += 'None' embed.add_field(name='Important Perms:', value=iperms) else: embed.add_field(name='There was an error.', value='Error') if detail > 1: # include notable perms nperms = '\n'.join(perm for perm, value in member.guild_permissions if str(perm) in sigperms if value) if len(nperms) < 1: nperms += 'None' embed.add_field(name='Notable Perms:', value=nperms) if detail > 2: # include the rest of the perms perms = '\n'.join(perm for perm, value in member.guild_permissions if str(perm) not in (basicperms + sigperms) if value) if len(perms) < 1: perms += 'None' embed.add_field(name='Other Perms:', value=perms) embed.set_footer(text=embed_footer(ctx.author)) await ctx.send(content=None, embed=embed, delete_after=deltime * 5) print( f'Perms command used by {ctx.author} at {now()} on member {member} with detail {detail}.' )
async def help(self, ctx, menu=None): if menu == "utility": embed = discord.Embed( colour=discord.Colour.orange(), title="🛠️ Utility commands", ) embed.add_field( name="👤 Accounts", value= "`stats`, `creatorstats`, `topsubscribed`, `topcreators`, `bio`, `pfp`, `banner`, `profile`, `junior`, `date`, `nickname`", inline=False) embed.add_field( name="🖼️ Images", value= "`photos`, `feed`, `latest`, `latestinby`, `latestwith` `latestfeed`, `oldest`, `oldestinby`, `oldestwith`, `oldestfeed`, `frontpage`, `takenin`, `takenof`, `takenofin`, `together`, `cheers`, `comments`, `photostats`, `sortby`, `bookmarked`, `blacklisted`", inline=False) embed.add_field( name="🚪 Rooms", value="`roominfo`, `roomsby`, `featured`, `placement`", inline=False) embed.add_field(name="<:RRQuestion:803587583187746847> Other", value="`apistatus`, `latestevents`, `shortcuts`", inline=False) elif menu == "other": embed = discord.Embed(colour=discord.Colour.orange(), title="📖 Other commands", description="`doc`, `invite`") elif menu == "random": embed = discord.Embed( colour=discord.Colour.orange(), title="<:RRQuestion:803587583187746847> \"Random\" commands", ) embed.add_field( name="🖼️ Images", value= "`randomimg`, `randomimgof`, `randomimgofin`,`randomimgby`, `randomimgbyin`, `randomimgin`, `randompfp`", inline=False) embed.add_field(name="📜 Bios", value="`randombio`, `cringebio`, `fastrandombio`", inline=False) embed.add_field( name="<:RRQuestion:803587583187746847> Other", value= "`randomaccount`, `randomroom`, `randomevent`, `randomloadscreen`", inline=False) elif menu == "search": embed = discord.Embed( colour=discord.Colour.orange(), title="🔎 Search commands", ) embed.add_field(name="📆 Events", value="`eventsearch`", inline=False) elif menu == "api": embed = discord.Embed( colour=discord.Colour.orange(), title="📲 API commands", ) embed.add_field(name="👤 Accounts", value="`accountdata`, `accountid`", inline=False) embed.add_field(name="🖼️ Images", value="`imageid`", inline=False) embed.add_field( name="These commands are experimental!", value= "They will probably all be combined into one command eventually. As of now, they're used to do simple API calls." ) elif menu == "menus": embed = discord.Embed( colour=discord.Colour.orange(), title="📟 Menu commands", description= "These commands utilize the slick menu system! They can also be found in other categories." ) embed.add_field( name="📟 Menus", value= "`frontpage`, `photos`, `feed`, `sortby`, `together`, `takenin`, `takenof`, `takenofin`", inline=False) elif menu == "legacy": embed = discord.Embed( colour=discord.Colour.orange(), title="👾 Legacy commands", description= "These commands are the original versions of some reworked commands." ) embed.add_field( name="👾 Legacy", value= "`lfrontpage`, `lsortby`, `ltogether`, `ltakenin`, `ltakenof`, `ltakenofin`", inline=False) elif menu == "economyy": embed = discord.Embed( colour=discord.Colour.orange(), title="<:RRtoken:825288414789107762> Economy commands", description="Economy is under development.") embed.add_field( name="<:RRtoken:825288414789107762> Economy", value= "`econprofile (ep)`, `econstats (estats)`, `inventory (inv)`, `play`, `boxes`, `unbox (ub)` `buy`, `gift`, `sell`, `sellall`, `badges`, `daily`, `beg`, `leaderboard`, `boosters`, `use`, `upgrade`, `mirror`, `equip`, `unequip`, `item`", inline=False) elif menu == "fun": embed = discord.Embed(colour=discord.Colour.orange(), title="😹 Fun commands") embed.add_field(name="🎮 Minigames", value="`boxsim`", inline=False) embed.add_field( name="📑 Checks", value="`cringebiocheck`, `cringenamecheck`, `selfcheers`", inline=False) embed.add_field(name="<:wholesome:796100757354053653> Other", value="`adjectiveanimal`", inline=False) else: embed = discord.Embed(colour=discord.Colour.orange(), title="RecNetBotV2 Command List") embed.add_field(name="🛠️ Utility", value="`.help utility`") embed.add_field(name="<:RRQuestion:803587583187746847> \"Random\"", value="`.help random`") embed.add_field(name="📟 Menus", value="`.help menus`") embed.add_field(name="🔎 Search", value="`.help search`") embed.add_field(name="😹 Fun", value="`.help fun`") embed.add_field(name="📲 API", value="`.help api`") embed.add_field(name="👾 Legacy", value="`.help legacy`") embed.add_field(name="📖 Other", value="`.help other`") #embed.add_field(name="<:RRtoken:825288414789107762> Economy (Early Alpha)", value="`.help economy`") rnb_stats = { 'TotalCount': None, 'GuildCount': len(self.client.guilds) } embed.add_field( name="Other", value= f"[Invite bot](https://discord.com/api/oauth2/authorize?client_id=788632031835324456&permissions=322624&scope=bot) | [Discord](https://discord.gg/GPVdhMa2zK)\n<:discord:803539862435135510> Server count: `{rnb_stats['GuildCount']}`", inline=False) functions.embed_footer(ctx, embed) await ctx.send(embed=embed)
async def cringebiocheck(self, ctx, profile): functions.log(ctx.guild.name, ctx.author, ctx.command) account = functions.check_account_existence_and_return(profile) if account: bio = functions.get_bio(account['account_id']) pfp = functions.id_to_pfp(account['account_id'], True) print( f"{ctx.command} > {account['account_id']}, {account['username']}, {bio}, {pfp}" ) embed = functions.default_embed() embed.add_field(name=f"{account['username']}'s bio:", value=f"```{bio}```") flags = "" cringe_check_list = functions.load("cringe_word_list.json") cringe_score = 0 cringe_rating_dict = { 0: "Not cringe!", 1: "A little cringe!", 2: "Cringe!", 3: "Very cringe!", 4: "Yikes..!", 5: "Radically cringe!", 6: "Super cringe!", 7: "Mega cringe!", 8: "Ultra cringe!", 9: "THE CRINGIEST!", 10: "All hope for humanity has been lost!" } if bio: split_bio = bio.split(" ") for word in split_bio: for flag in cringe_check_list: if flag.casefold() in word.casefold(): cringe_score += 1 flags += f"`{flag}`, " if cringe_score > len(cringe_rating_dict) - 1: cringe_rating = cringe_rating_dict[len(cringe_rating_dict) - 1] else: cringe_rating = cringe_rating_dict[cringe_score] embed.add_field(name="Cringe score", value=f"`{cringe_score}` ({cringe_rating})", inline=False) if flags: embed.add_field( name="Flags", value= f"||{flags}||\nThis command is just for fun, and not meant to shame anybody!", inline=False) embed.set_author(name=f"🔗 {account['username']}'s profile", url=f"https://rec.net/user/{account['username']}", icon_url=pfp) else: embed = functions.error_msg(ctx, f"User `@{profile}` doesn't exist!") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def cringenamecheck(self, ctx, profile): functions.log(ctx.guild.name, ctx.author, ctx.command) account = functions.check_account_existence_and_return(profile) if account: embed = functions.default_embed() cringe_check_list = functions.load("cringe_word_list.json") cringe_score = 0 cringe_rating = { 0: "Not cringe!", 1: "Maybe a little cringe?", 2: "Little cringe.", 3: "A bit cringe!", 4: "Cringe!", 5: "Quite cringe!", 6: "Very cringe!", 7: "Super cringe!", 8: "Incredibly cringe!", 9: "Ludicrously cringe!", 10: "THE CRINGIEST!" } display_name = functions.id_to_display_name(account['account_id']) cringe_words = [ ele for ele in cringe_check_list if (ele.casefold() in display_name.casefold()) ] cringe_score = len(cringe_words) * 2 for char in display_name: if not char.isalpha(): cringe_score += 1 cringe_words.append(char) if cringe_score > 10: cringe_score = 10 embed.add_field(name=f"{account['username']}'s display name:", value=f"```{display_name}```") embed.add_field( name="Cringe score", value=f"`{cringe_score}` ({cringe_rating[cringe_score]})", inline=False) flags = "" for flag in cringe_words: flags += f"`{flag}`, " if flags: embed.add_field( name="Flags", value= f"||{flags}||\nThis command is just for fun, and not meant to shame anybody!", inline=False) pfp = functions.id_to_pfp(account['account_id'], True) embed.set_author(name=f"🔗 {account['username']}'s profile", url=f"https://rec.net/user/{account['username']}", icon_url=pfp) else: embed = functions.error_msg(ctx, f"User `@{profile}` doesn't exist!") functions.embed_footer(ctx, embed) # get default footer from function await ctx.send(embed=embed)
async def adjectiveanimal(self, ctx): functions.log(ctx.guild.name, ctx.author, ctx.command) adjectives = [ "Polite", "Sizzling", "Joyful", "Zany" "Selfish", "Sleepy" "Agreeable", "Friendly", "Wise", "Helpful", "Pervasive", "Hasty", "Odd", "Enthusiastic", "Slow", "Lazy", "Cheerful", "Unusual", "Shining", "Busy", "Calm", "Nice", "Enchanting", "Icy", "Luminous", "Hasty", "Nimble", "Majestic", "Alert", "Aromatic", "Rapid", "Loyal", "Aimless", "Majestic", "Friendly", "Plucky", "Grimy", "Nimble", "Strict" "Pleasant", "Wild" ] animals = [ "Emu", "Quail", "Possum", "Viper", "Shark", "Snail", "Chimpanzee", "Giraffe", "Gorilla", "Lizard", "Piranha", "Jellyfish", "Squirrel", "Scorpion", "Hippo", "Caterpillar", "Alpaca", "Otter", "Tortoise", "Panther", "Koala", "Bat", "Frog", "Buffalo", "Squirrel", "Vulture", "Urchin", "Newt", "Eagle", "Ostrich", "Marmoset", "Chameleon", "Kitten", "Monkey", "Cheetah", "Walrus", "Badger", ] adjective = adjectives[random.randint(0, len(adjectives) - 1)] animal = animals[random.randint(0, len(animals) - 1)] name = adjective + animal accounts_with_name = 0 response = requests.get( f"https://accounts.rec.net/account/search?name={name}") if response.ok: accounts = response.json() for account in accounts: if name.casefold() in account['username'].casefold(): accounts_with_name += 1 if accounts_with_name == 50: accounts_with_name = "50+" else: accounts_with_name = 0 embed = discord.Embed( title="Your adjective animal name:", description= f"**{name}**\nAccounts with that username: `{accounts_with_name}`", colour=discord.Colour.orange()) embed = functions.embed_footer(ctx, embed) await ctx.send(embed=embed)