From b1085737011f6a5ac7a8f13d42a78eece063d505 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 20:08:21 +0300 Subject: [PATCH 01/84] Update clashroyale.py --- cogs/community/clashroyale.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 85508abd..6c08da63 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -60,9 +60,12 @@ async def profile(self, ctx, tag=None): em.description = "Either API is down or that's an invalid tag." return await ctx.send(embed=em) + level = str(profile.current_trophies)) + em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" + em.add_field = (name=Level, value=level) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 5f810e5016f09f302ecca4c29a414810f6e20e19 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 20:13:04 +0300 Subject: [PATCH 02/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 6c08da63..84f5ea7c 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -65,7 +65,7 @@ async def profile(self, ctx, tag=None): em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field = (name=Level, value=level) + em.add_field = (name='Level', value=level) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From b863a0c83ba27291f32e1e5238824c8a5cc40711 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 20:34:46 +0300 Subject: [PATCH 03/84] Update clashroyale.py --- cogs/community/clashroyale.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 84f5ea7c..efb4840b 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -60,17 +60,18 @@ async def profile(self, ctx, tag=None): em.description = "Either API is down or that's an invalid tag." return await ctx.send(embed=em) - level = str(profile.current_trophies)) + trophies = str(profile.current_trophies) em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field = (name='Level', value=level) + em.add_field = (name='Current Trophies', value=trophies) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: em.set_author(name='Profile') + await ctx.send(embed=em) From a5120b5ffddb6674b3e82a9ac2b596103383c993 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 20:39:19 +0300 Subject: [PATCH 04/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index efb4840b..1cf9e041 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -65,7 +65,7 @@ async def profile(self, ctx, tag=None): em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field = (name='Current Trophies', value=trophies) + em.add_field(name='Current Trophies', value=trophies) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 86c7b4f5891a1c04a804edf96a6fc846ca5639a2 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 22:33:59 +0300 Subject: [PATCH 05/84] Update clashroyale.py --- cogs/community/clashroyale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 1cf9e041..a5315c47 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -61,11 +61,12 @@ async def profile(self, ctx, tag=None): return await ctx.send(embed=em) trophies = str(profile.current_trophies) + pb = str(profile.highest_trophies) em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field(name='Current Trophies', value=trophies) + em.add_field(name='Current Trophies', value=trophies + pb) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From c830540633bc7f4ed8319b9ec500b2cf4f57cc13 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 23:09:39 +0300 Subject: [PATCH 06/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index a5315c47..64e98d3e 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -66,7 +66,7 @@ async def profile(self, ctx, tag=None): em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field(name='Current Trophies', value=trophies + pb) + em.add_field(name='Current Trophies', value=trophies + "\n" + "Highest Trophies + "\n" + pb) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 46a4fbf3ce8dc467ec9db7796e6aef1ae8d3c8bb Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 23:10:42 +0300 Subject: [PATCH 07/84] Forgot a quote lol --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 64e98d3e..8c5e70d9 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -66,7 +66,7 @@ async def profile(self, ctx, tag=None): em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field(name='Current Trophies', value=trophies + "\n" + "Highest Trophies + "\n" + pb) + em.add_field(name='Current Trophies', value=trophies + "\n" + "Highest Trophies" + "\n" + pb) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From e92fcd9fb7d37e0337ae576acc8189aacf7b42b4 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 23:18:38 +0300 Subject: [PATCH 08/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 8c5e70d9..22d2d508 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -62,11 +62,13 @@ async def profile(self, ctx, tag=None): trophies = str(profile.current_trophies) pb = str(profile.highest_trophies) + xp = str(profile.level) em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" em.add_field(name='Current Trophies', value=trophies + "\n" + "Highest Trophies" + "\n" + pb) + em.add_field(name='Player XP', value=xp) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From c804ff20ced75796317f5d7c5dde415710e2ef1a Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 7 Nov 2017 23:45:42 +0300 Subject: [PATCH 09/84] Update clashroyale.py --- cogs/community/clashroyale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 22d2d508..64b44e7b 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -67,7 +67,8 @@ async def profile(self, ctx, tag=None): em.title = profile.name em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field(name='Current Trophies', value=trophies + "\n" + "Highest Trophies" + "\n" + pb) + em.add_field(name='Current Trophies', value=trophies) + em.add_field(name='Highest Trophies',value=pb) em.add_field(name='Player XP', value=xp) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) From c0cb755cd329cbe34f73a81ed961b934f9a46225 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 00:33:36 +0300 Subject: [PATCH 10/84] Update clashroyale.py --- cogs/community/clashroyale.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 64b44e7b..1035d925 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -63,6 +63,9 @@ async def profile(self, ctx, tag=None): trophies = str(profile.current_trophies) pb = str(profile.highest_trophies) xp = str(profile.level) + playerwins = str(profile.wins) + playerlosses = str(profile.losses) + playerdraws = str(profile.draws) em.title = profile.name em.description = f"#{tag}" @@ -70,6 +73,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) em.add_field(name='Player XP', value=xp) + em.add_field(name='Wins/Losses/Draws', value=playerwins + '/' + playerlosses + '/' playerdraws) try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From e8b24628181401ad13139b7dbb5929a537293b2c Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 00:43:33 +0300 Subject: [PATCH 11/84] Update clashroyale.py --- cogs/community/clashroyale.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 1035d925..70067a3d 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -63,9 +63,7 @@ async def profile(self, ctx, tag=None): trophies = str(profile.current_trophies) pb = str(profile.highest_trophies) xp = str(profile.level) - playerwins = str(profile.wins) - playerlosses = str(profile.losses) - playerdraws = str(profile.draws) + em.title = profile.name em.description = f"#{tag}" @@ -73,7 +71,8 @@ async def profile(self, ctx, tag=None): em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) em.add_field(name='Player XP', value=xp) - em.add_field(name='Wins/Losses/Draws', value=playerwins + '/' + playerlosses + '/' playerdraws) + em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') + try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 45b95284b84c01d0e6a0622cf9e6d303a51feb5f Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 01:12:22 +0300 Subject: [PATCH 12/84] Thumbnail and xp --- cogs/community/clashroyale.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 70067a3d..d3a972bd 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -66,13 +66,16 @@ async def profile(self, ctx, tag=None): em.title = profile.name - em.description = f"#{tag}" + em.description = f"#{tag} + em.set_thumbnail(url=profile.arena.image_url) em.url = f"http://cr-api.com/profile/{tag}" em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) em.add_field(name='Player XP', value=xp) + em.add_field(name='Level(Experience)', value='/'.join(profile.experience)) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') - + + try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From b10282719727d63d28d7acaac5e8230310dcde66 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 01:19:49 +0300 Subject: [PATCH 13/84] Update clashroyale.py --- cogs/community/clashroyale.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index d3a972bd..23f774d6 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -66,16 +66,15 @@ async def profile(self, ctx, tag=None): em.title = profile.name - em.description = f"#{tag} em.set_thumbnail(url=profile.arena.image_url) + em.description = f"#{tag} em.url = f"http://cr-api.com/profile/{tag}" em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) em.add_field(name='Player XP', value=xp) em.add_field(name='Level(Experience)', value='/'.join(profile.experience)) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') - - + try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 7a8ab77f81693ca58c8e1133fcb051166ff32ef7 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 01:21:08 +0300 Subject: [PATCH 14/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 23f774d6..2f199432 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -67,7 +67,7 @@ async def profile(self, ctx, tag=None): em.title = profile.name em.set_thumbnail(url=profile.arena.image_url) - em.description = f"#{tag} + em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) From 51c6965e4f6dbfc7ad7af3444cc4257b1ace6de2 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 02:00:04 +0300 Subject: [PATCH 15/84] Update clashroyale.py --- cogs/community/clashroyale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 2f199432..28f0bf43 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -63,7 +63,7 @@ async def profile(self, ctx, tag=None): trophies = str(profile.current_trophies) pb = str(profile.highest_trophies) xp = str(profile.level) - + experience = str(profile.experience[0]) + '/' + str(profile.experience[1]) em.title = profile.name em.set_thumbnail(url=profile.arena.image_url) @@ -72,7 +72,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) em.add_field(name='Player XP', value=xp) - em.add_field(name='Level(Experience)', value='/'.join(profile.experience)) + em.add_field(name='Level(Experience)', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') try: From 7c02ae46ac2296de7b9edf88742a84fb382c00f2 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 02:21:37 +0300 Subject: [PATCH 16/84] Update clashroyale.py --- cogs/community/clashroyale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 28f0bf43..414f0451 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -42,7 +42,7 @@ def __init__(self, bot): tag = config['CR_TAG'] self.tag = os.environ.get('CR_TAG') or tag self.client = crasync.Client() - + @commands.command() async def profile(self, ctx, tag=None): @@ -51,6 +51,7 @@ async def profile(self, ctx, tag=None): em.color = await ctx.get_dominant_color(ctx.author.avatar_url) if tag == None: tag = self.tag + tag = tag.strip('#').replace('O', '0') if tag == None: em.description = "Please add `CR_TAG` to your config." return await ctx.send(embed=em) From 697dca76d1dcc544c22ccfdc4a6f3bb3e2c4d505 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 02:32:03 +0300 Subject: [PATCH 17/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 414f0451..907b237b 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -51,10 +51,10 @@ async def profile(self, ctx, tag=None): em.color = await ctx.get_dominant_color(ctx.author.avatar_url) if tag == None: tag = self.tag - tag = tag.strip('#').replace('O', '0') if tag == None: em.description = "Please add `CR_TAG` to your config." return await ctx.send(embed=em) + tag = tag.strip('#').replace('O', '0') try: profile = await self.client.get_profile(tag) except: From 681ede5bc5aabe10aad36f57e30437a93e85376d Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 19:13:42 +0300 Subject: [PATCH 18/84] Update clashroyale.py --- cogs/community/clashroyale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 907b237b..a452f0c5 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -72,8 +72,8 @@ async def profile(self, ctx, tag=None): em.url = f"http://cr-api.com/profile/{tag}" em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) - em.add_field(name='Player XP', value=xp) - em.add_field(name='Level(Experience)', value=experience) + em.add_field(name='Level', value=xp) + em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') try: From 7517dd3a9a9c953d7a38bffce9314a17583b51cf Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 19:17:57 +0300 Subject: [PATCH 19/84] Update clashroyale.py --- cogs/community/clashroyale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index a452f0c5..4ad4a040 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -75,7 +75,8 @@ async def profile(self, ctx, tag=None): em.add_field(name='Level', value=xp) em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') - + em.add_field(name='Global Rank', value=f'{profile.global_rank}') + try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From dfb853aab9607656fdb8c2fe161d03d77775fb46 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 19:52:55 +0300 Subject: [PATCH 20/84] Update clashroyale.py --- cogs/community/clashroyale.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 4ad4a040..fa00a890 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -76,6 +76,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') em.add_field(name='Global Rank', value=f'{profile.global_rank}') + em.add_field(name='Clan Name', value=f'{profile.clan.name}') try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) From 7442b9618ffadb287cedc487780e720fd4be0e60 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 19:58:26 +0300 Subject: [PATCH 21/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index fa00a890..f27f09d3 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -76,7 +76,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') em.add_field(name='Global Rank', value=f'{profile.global_rank}') - em.add_field(name='Clan Name', value=f'{profile.clan.name}') + em.add_field(name='Clan Name', value=f'{profile.clan_name}') try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) From 29f36efa77279ab9b98a38c5ecf273c9b6a99a1d Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 20:08:07 +0300 Subject: [PATCH 22/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index f27f09d3..05c9a416 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -76,7 +76,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') em.add_field(name='Global Rank', value=f'{profile.global_rank}') - em.add_field(name='Clan Name', value=f'{profile.clan_name}') + em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) From 231048b9c05e666c53f0688737571140a91fa87b Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 8 Nov 2017 20:11:33 +0300 Subject: [PATCH 23/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 05c9a416..12758e0d 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -76,7 +76,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') em.add_field(name='Global Rank', value=f'{profile.global_rank}') - em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') + em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) From e3aea385ef404c917fc11cc4a42704975e4339dc Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:21:31 -0900 Subject: [PATCH 24/84] Added Win streak --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 12758e0d..07a224e0 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -77,7 +77,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') em.add_field(name='Global Rank', value=f'{profile.global_rank}') em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') - + em.add_field(name='Win Streak', value=f'{profile.win_streak}') try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 28d5f386529529fd37cca46c59530e8c9082ce96 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:26:58 -0900 Subject: [PATCH 25/84] Added Legend Trophies --- cogs/community/clashroyale.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 07a224e0..5e5c60e2 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -72,6 +72,7 @@ async def profile(self, ctx, tag=None): em.url = f"http://cr-api.com/profile/{tag}" em.add_field(name='Current Trophies', value=trophies) em.add_field(name='Highest Trophies',value=pb) + em.add_field(name='Legend Trophies', value=f'{profile.legend_trophies}') em.add_field(name='Level', value=xp) em.add_field(name='Experience', value=experience) em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') From a0adcac782dc7379ce6f736ead579346305f3daa Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:37:55 -0900 Subject: [PATCH 26/84] First time trying to do Footer --- cogs/community/clashroyale.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 5e5c60e2..d2a7cd33 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -79,6 +79,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Global Rank', value=f'{profile.global_rank}') em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') em.add_field(name='Win Streak', value=f'{profile.win_streak}') + em.set_footer(text"Powered By cr-api.com") try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From e37e274230e688cd4bd1d9e846b341d476ad0b9c Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:40:28 -0900 Subject: [PATCH 27/84] Update clashroyale.py --- cogs/community/clashroyale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index d2a7cd33..5529911d 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -79,7 +79,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Global Rank', value=f'{profile.global_rank}') em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') em.add_field(name='Win Streak', value=f'{profile.win_streak}') - em.set_footer(text"Powered By cr-api.com") + em.set_footer(text="Powered By cr-api.com") try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 86b2b4b4313faf6c94d1e8d72a5c09728069e556 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:48:44 -0900 Subject: [PATCH 28/84] Footer icon --- cogs/community/clashroyale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 5529911d..36e5455b 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -79,7 +79,8 @@ async def profile(self, ctx, tag=None): em.add_field(name='Global Rank', value=f'{profile.global_rank}') em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') em.add_field(name='Win Streak', value=f'{profile.win_streak}') - em.set_footer(text="Powered By cr-api.com") + em.set_footer(text="Powered By cr-api.com", icon_url="http://cr-api.com/static/img/branding/cr-api-logo.png") + try: try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 26446b82945a36691adbe69d1766841f68c50a65 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:53:27 -0900 Subject: [PATCH 29/84] Update clashroyale.py --- cogs/community/clashroyale.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 36e5455b..2d24edc0 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -80,7 +80,6 @@ async def profile(self, ctx, tag=None): em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') em.add_field(name='Win Streak', value=f'{profile.win_streak}') em.set_footer(text="Powered By cr-api.com", icon_url="http://cr-api.com/static/img/branding/cr-api-logo.png") - try: try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From 3f2db66b4aaf184405388090a66246bce7fea174 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 05:59:12 -0900 Subject: [PATCH 30/84] Update clashroyale.py --- cogs/community/clashroyale.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 2d24edc0..79cf3e61 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -80,6 +80,7 @@ async def profile(self, ctx, tag=None): em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') em.add_field(name='Win Streak', value=f'{profile.win_streak}') em.set_footer(text="Powered By cr-api.com", icon_url="http://cr-api.com/static/img/branding/cr-api-logo.png") + try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: From beee1628f7e8eb953e965a045f33fbd7a94e4713 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Mon, 13 Nov 2017 06:12:57 -0900 Subject: [PATCH 31/84] Clash Royale Cog Added Clash Royale Cog Not Fully Ready But I'll Add More Later This Should Be Good For Now --- cogs/community/clashroyale.py | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 85508abd..39aa829f 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -1,18 +1,14 @@ ''' MIT License - Copyright (c) 2017 Grok - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -42,7 +38,7 @@ def __init__(self, bot): tag = config['CR_TAG'] self.tag = os.environ.get('CR_TAG') or tag self.client = crasync.Client() - + @commands.command() async def profile(self, ctx, tag=None): @@ -54,22 +50,41 @@ async def profile(self, ctx, tag=None): if tag == None: em.description = "Please add `CR_TAG` to your config." return await ctx.send(embed=em) + tag = tag.strip('#').replace('O', '0') try: profile = await self.client.get_profile(tag) except: em.description = "Either API is down or that's an invalid tag." return await ctx.send(embed=em) + trophies = str(profile.current_trophies) + pb = str(profile.highest_trophies) + xp = str(profile.level) + experience = str(profile.experience[0]) + '/' + str(profile.experience[1]) + em.title = profile.name + em.set_thumbnail(url=profile.arena.image_url) em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" + em.add_field(name='Current Trophies', value=trophies) + em.add_field(name='Highest Trophies',value=pb) + em.add_field(name='Legend Trophies', value=f'{profile.legend_trophies}') + em.add_field(name='Level', value=xp) + em.add_field(name='Experience', value=experience) + em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') + em.add_field(name='Global Rank', value=f'{profile.global_rank}') + em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') + em.add_field(name='Win Streak', value=f'{profile.win_streak}') + em.set_footer(text="Powered By cr-api.com", icon_url="http://cr-api.com/static/img/branding/cr-api-logo.png") + try: em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: em.set_author(name='Profile') + await ctx.send(embed=em) def setup(bot): - bot.add_cog(ClashRoyale(bot)) + bot.add_cog(ClashRoyale(bot)) From 31a9fe1c902fabad93cc35a7a0258074964720bc Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 14 Nov 2017 08:20:39 -0900 Subject: [PATCH 32/84] New Custom Command: hi/await ctx.send("Hey") --- data/cc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/cc.json b/data/cc.json index 0967ef42..1e7d55d6 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1 +1 @@ -{} +{"hi": "await ctx.send("Hey")"} \ No newline at end of file From a420d59fefc8baf8a2f710dda3769dcc4b7aaa65 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 14 Nov 2017 08:26:09 -0900 Subject: [PATCH 33/84] Cleaned --- data/cc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/cc.json b/data/cc.json index 1e7d55d6..0967ef42 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1 +1 @@ -{"hi": "await ctx.send("Hey")"} \ No newline at end of file +{} From 1be0c4dea1d6635050d9c6cfc65ba011c34692c7 Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Tue, 14 Nov 2017 08:28:26 -0900 Subject: [PATCH 34/84] New Custom Command: test/lol --- data/cc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/cc.json b/data/cc.json index 0967ef42..975edf67 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1 +1 @@ -{} +{"test": "lol"} \ No newline at end of file From 3f53fd431332f85faa7c019b08080b3e24c68a70 Mon Sep 17 00:00:00 2001 From: fourjr Date: Wed, 15 Nov 2017 20:30:59 +0800 Subject: [PATCH 35/84] @XAOS1502's #175 #176 --- cogs/community/nsfw.py | 81 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 cogs/community/nsfw.py diff --git a/cogs/community/nsfw.py b/cogs/community/nsfw.py new file mode 100644 index 00000000..1d98467a --- /dev/null +++ b/cogs/community/nsfw.py @@ -0,0 +1,81 @@ +""" +MIT License + +Copyright (c) 2017 Grok's naughty dev XAOS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +""" + +import discord +from discord.ext import commands +import bs4 as bs +import urllib.request +from bs4 import BeautifulSoup +from urllib.request import Request, urlopen +import json +import io + +class Nsfw: + """Nsfw commands.""" + def __init__(self, bot): + self.bot = bot + + async def __local_check(self, ctx): + if not ctx.channel.is_nsfw(): + return False + git = self.bot.get_cog('Git') + if not await git.starred('verixx/selfbot.py'): + return False + return True + + @commands.command() + async def xbooru(self, ctx): + """Random image from Xbooru""" + try: + try: + await ctx.message.delete() + except discord.Forbidden: + pass + await ctx.channel.trigger_typing() + query = urllib.request.urlopen("http://xbooru.com/index.php?page=post&s=random").read() + soup = bs.BeautifulSoup(query, 'html.parser') + image = soup.find(id="image").get("src") + last = str(image.split('?')[-2]).replace('//', '/').replace(':/', '://') + em = discord.Embed(colour=discord.Colour(0xed791d)) + em.description = f'[Full Size Link*]({last})' + em.set_image(url=last) + em.set_footer(text='* click link at your own risk!') + try: + await ctx.send(embed=em) + except discord.HTTPException: + await ctx.send('Unable to send embeds here!') + try: + async with ctx.session.get(image) as resp: + image = await resp.read() + with io.BytesIO(image) as file: + await ctx.send(file=discord.File(file, 'xbooru.png')) + except discord.HTTPException: + await ctx.send(image) + + except Exception as e: + await ctx.send(f'```{e}```') + + +def setup(bot): + bot.add_cog(Nsfw(bot)) From 170dc87bcec2bf6ec2a4052a7367f0d6c0cf0156 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 20:44:05 +0800 Subject: [PATCH 36/84] Fix cc --- cogs/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index bdb2b262..d4d3030a 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1070,7 +1070,7 @@ async def make(self, ctx, name, *, content): cmdtype = 'pycc' await self.edit_to_codeblock(ctx, content, pycc=True) else: - commands['text'].update({name: content}) + commands['textcc'].update({name: content}) cmdtype = 'text' if await ctx.updatedata('data/cc.json', json.dumps(commands, indent=4), f'New {cmdtype} Command: {name}'): await ctx.send(f'Created {cmdtype} command.') @@ -1186,8 +1186,7 @@ async def on_message(self, message): utils = self.bot.get_cog('Utility') await (await self.bot.get_context(message)).invoke(utils._eval, body=commands['pycc'][message.content.strip(await self.bot.get_pre(self.bot, message))], edit=False) except KeyError: - pass - + pass def setup(bot): From 29e2b5a9f12cda5445bbdad133eca09561e9d545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 18:18:34 +0530 Subject: [PATCH 37/84] Okay :heart: --- data/community_cogs.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/community_cogs.txt b/data/community_cogs.txt index bda65a9b..0daed8f2 100644 --- a/data/community_cogs.txt +++ b/data/community_cogs.txt @@ -1 +1,2 @@ -clashroyale \ No newline at end of file +nsfw +clashroyale From 1be2502a3b71d7a08b0741ae5f782ea7c84d862d Mon Sep 17 00:00:00 2001 From: freetnt5852 <31079629+freetnt5852@users.noreply.github.com> Date: Wed, 15 Nov 2017 04:03:20 -0900 Subject: [PATCH 38/84] Update cc.json --- data/cc.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data/cc.json b/data/cc.json index 975edf67..b5abd00f 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1 +1,8 @@ -{"test": "lol"} \ No newline at end of file +{ + "pycc":{ + + }, + "textcc":{ + + } +} From e397f5ba61b4e0c739d33ad5b1547ec98c27dff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 18:34:04 +0530 Subject: [PATCH 39/84] To load nsfw cog Have fun! --- selfbot.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/selfbot.py b/selfbot.py index fd47a572..c8837ad3 100644 --- a/selfbot.py +++ b/selfbot.py @@ -196,6 +196,19 @@ async def ping(self, ctx): for page in em_list: await ctx.send(page) + @commands.command(aliases=["loadcog"]) + async def load(self, ctx, *, cog: str): + """ Load an unloaded cog + For example: {p}load nsfw """ + if ctx.author.id in dev_list: + cog = f"cogs.{cog}" + await ctx.send(f"Preparing to load {cog}...", delete_after=5) + try: + self.load_extension(cog) + await ctx.send(f"{cog} cog was loaded successfully!", delete_after=5) + except Exception as e: + await ctx.send(f"```py\nError loading {cog}:\n\n{e}\n```", delete_after=5) + if __name__ == '__main__': Selfbot.init() From 4cbbe018ea50a99ea8faecadb36bb143ade8a221 Mon Sep 17 00:00:00 2001 From: fourjr Date: Wed, 15 Nov 2017 21:05:43 +0800 Subject: [PATCH 40/84] remove nsfw from load example --- selfbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfbot.py b/selfbot.py index c8837ad3..aab7c891 100644 --- a/selfbot.py +++ b/selfbot.py @@ -199,7 +199,7 @@ async def ping(self, ctx): @commands.command(aliases=["loadcog"]) async def load(self, ctx, *, cog: str): """ Load an unloaded cog - For example: {p}load nsfw """ + For example: {p}load mod""" if ctx.author.id in dev_list: cog = f"cogs.{cog}" await ctx.send(f"Preparing to load {cog}...", delete_after=5) From 324b83923142c99cd2f18749f7a77b3f1617a23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 18:41:06 +0530 Subject: [PATCH 41/84] k3k :thinking: --- selfbot.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/selfbot.py b/selfbot.py index aab7c891..38df7232 100644 --- a/selfbot.py +++ b/selfbot.py @@ -200,14 +200,13 @@ async def ping(self, ctx): async def load(self, ctx, *, cog: str): """ Load an unloaded cog For example: {p}load mod""" - if ctx.author.id in dev_list: - cog = f"cogs.{cog}" - await ctx.send(f"Preparing to load {cog}...", delete_after=5) - try: - self.load_extension(cog) - await ctx.send(f"{cog} cog was loaded successfully!", delete_after=5) - except Exception as e: - await ctx.send(f"```py\nError loading {cog}:\n\n{e}\n```", delete_after=5) + cog = f"cogs.{cog}" + await ctx.send(f"Preparing to load {cog}...", delete_after=5) + try: + self.load_extension(cog) + await ctx.send(f"{cog} cog was loaded successfully!", delete_after=5) + except Exception as e: + await ctx.send(f"```py\nError loading {cog}:\n\n{e}\n```", delete_after=5) if __name__ == '__main__': From 28604ac8a1144b4eaa5f0662bb699d38e6accded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 18:43:00 +0530 Subject: [PATCH 42/84] Need that as well :thinking: --- selfbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/selfbot.py b/selfbot.py index 38df7232..d813554a 100644 --- a/selfbot.py +++ b/selfbot.py @@ -65,6 +65,7 @@ def __init__(self, **attrs): self.remove_command('help') self.add_command(self.ping) self.load_extensions() + self.add_command(self.load) self.load_community_extensions() def load_extensions(self, cogs=None, path='cogs.'): From c663c6a766c47904c9e46e5cb27af7f3e3b705e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 18:52:01 +0530 Subject: [PATCH 43/84] In case it is needed :thinking: --- selfbot.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/selfbot.py b/selfbot.py index d813554a..66529624 100644 --- a/selfbot.py +++ b/selfbot.py @@ -209,6 +209,18 @@ async def load(self, ctx, *, cog: str): except Exception as e: await ctx.send(f"```py\nError loading {cog}:\n\n{e}\n```", delete_after=5) + @commands.command(aliases=["reload"]) + async def reloadcog(self, ctx, *, cog: str): + """ Reload any cog """ + cog = f"cogs.{cog}" + await ctx.send(f"Preparing to reload {cog}...", delete_after=5) + self.unload_extension(cog) + try: + self.load_extension(cog) + await ctx.send(f"{cog} cog was reloaded successfully!", delete_after=5) + except Exception as e: + await ctx.send(f"```py\nError loading {cog}:\n\n{e}\n```", delete_after=5) + if __name__ == '__main__': Selfbot.init() From e99f8f0a0f596d9bef41dcce75122ddf30bfe936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 18:58:41 +0530 Subject: [PATCH 44/84] Added load & reload commands to use nsfw cog after starring main repo Now nsfw cogs will not load automatically, but can be loaded manually via command using `load nsfw` This is so to prevent people from unintentionally hitting help and showing everyone how lewd they really are deep down in the core of their hentai souls... amen --- selfbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/selfbot.py b/selfbot.py index 66529624..882165c6 100644 --- a/selfbot.py +++ b/selfbot.py @@ -66,6 +66,7 @@ def __init__(self, **attrs): self.add_command(self.ping) self.load_extensions() self.add_command(self.load) + self.add_command(self.reloadcog) self.load_community_extensions() def load_extensions(self, cogs=None, path='cogs.'): From 2da5e46976af159e8356a2d2fc0460e72b363b05 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 21:29:37 +0800 Subject: [PATCH 45/84] Shift options to options.json, clean up list commands --- .gitignore | 5 +-- cogs/community/clashroyale.py | 13 +++--- cogs/utils.py | 74 ++++++++++++++++------------------- data/options.json | 5 +++ 4 files changed, 47 insertions(+), 50 deletions(-) create mode 100644 data/options.json diff --git a/.gitignore b/.gitignore index eb477e4c..06e6fcf6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,5 @@ __pycache__/ *.py[cod] *$py.class *.DS_Store -*.json -cogs/testsplit.py -data/community_cogs.txt +cogs/testsplit.py +data/community_cogs.txt diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 85508abd..5283d92d 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -34,13 +34,12 @@ class ClashRoyale: def __init__(self, bot): self.bot = bot - with open('data/config.json') as f: - config = json.load(f) - if 'CR_TAG' not in config: - tag = None + with open('data/options.json') as f: + options = json.load(f) + if 'CR_TAG' not in options: + self.tag = None else: - tag = config['CR_TAG'] - self.tag = os.environ.get('CR_TAG') or tag + self.tag = options['CR_TAG'] self.client = crasync.Client() @@ -52,7 +51,7 @@ async def profile(self, ctx, tag=None): if tag == None: tag = self.tag if tag == None: - em.description = "Please add `CR_TAG` to your config." + em.description = "Please add `CR_TAG` to your options. Do `{p}options edit cr_tag `" return await ctx.send(embed=em) try: profile = await self.client.get_profile(tag) diff --git a/cogs/utils.py b/cogs/utils.py index d4d3030a..ff2533a4 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1120,54 +1120,27 @@ async def delete(self, ctx, *, name): if await ctx.updatedata('data/cc.json', json.dumps(commands, indent=4), f'Deleted text Command: {name}'): await ctx.send('Deleted text command.') - @cc.command() - async def list(self, ctx, option:str = 'all'): + @cc.command(name='list') + async def _list(self, ctx, option:str = 'all'): '''Displays a list of your current custom commands''' git = self.bot.get_cog('Git') if not await git.starred('verixx/selfbot.py'): return await ctx.send('**This command is disabled as the user have not starred **') - with open('data/cc.json') as f: - commands = json.load(f) - pages = [] - fmt = '' if option == 'all': - fmt += '**Text Custom Commands**' - for commandtxt in commands['textcc']: - if len(fmt) + len(commandtxt) + 3 + len(commands['textcc'][commandtxt]) > 2000: - pages.append(fmt) - fmt = '' - fmt += '\n' + commandtxt + ': ' + commands['textcc'][commandtxt] - fmt += '\n\n**Python Custom Commands' - for commandtxt2 in commands['pycc']: - if len(fmt) + len(commandtxt2) + 3 + len(commands['pycc'][commandtxt2]) > 2000: - pages.append(fmt) - fmt = '' - fmt += '\n' + commandtxt2 + ': ' + commands['pycc'][commandtxt2] - for page in pages: - await ctx.send(page) - await ctx.send(fmt) + with open('data/cc.json') as f: + await ctx.send('```json\n' + json.dumps(json.load(f), indent=4) + '\n```') elif option == 'text': - fmt += '**Text Custom Commands**' - for commandtxt in commands['textcc']: - if len(fmt) + len(commandtxt) + 3 + len(commands['textcc'][commandtxt]) > 2000: - pages.append(fmt) - fmt = '' - fmt += '\n' + commandtxt + ': ' + commands['textcc'][commandtxt] - for page in pages: - await ctx.send(page) - await ctx.send(fmt) + with open('data/cc.json') as f: + commands = json.load(f) + del commands['pycc'] + await ctx.send('```json\n' + json.dumps(commands, indent=4) + '\n```') elif option == 'pycc': - fmt += '\n\n**Python Custom Commands**' - for commandtxt in commands['pycc']: - if len(fmt) + len(commandtxt) + 5 + len(commands['pycc'][commandtxt]) > 2000: - pages.append(fmt) - fmt = '' - fmt += '\n' + commandtxt + ': `' + commands['pycc'][commandtxt] + '`' - for page in pages: - await ctx.send(page) - await ctx.send(fmt) + with open('data/cc.json') as f: + commands = json.load(f) + del commands['textcc'] + await ctx.send('```json\n' + json.dumps(commands, indent=4) + '\n```') else: await ctx.send('Invalid option. Available options: `text`, `pycc`, `all`') @@ -1186,8 +1159,29 @@ async def on_message(self, message): utils = self.bot.get_cog('Utility') await (await self.bot.get_context(message)).invoke(utils._eval, body=commands['pycc'][message.content.strip(await self.bot.get_pre(self.bot, message))], edit=False) except KeyError: - pass + pass + @commands.group(invoke_without_command=True) + async def options(self, ctx): + pass + @options.command() + async def edit(self, ctx, name, *, value): + name = name.upper() + with open('data/options.json') as f: + options = json.load(f) + try: + options[name] + except KeyError: + return await ctx.send('Not a valid option. View all with `{p}options list`') + else: + options[name] = value + if await ctx.updatedata('data/options.json', json.dumps(options, indent=4), f'Update option: {name}'): + await ctx.send('Option edited. Now wait for me to restart!') + + @options.command(name='list') + async def __list(self, ctx): + with open ('data/options.json') as f: + await ctx.send('```json\n' + json.dumps(json.load(f), indent=4) + '\n```') def setup(bot): bot.add_cog(Utility(bot)) diff --git a/data/options.json b/data/options.json new file mode 100644 index 00000000..48779d09 --- /dev/null +++ b/data/options.json @@ -0,0 +1,5 @@ +{ + "CR_TAG":"your clash royale tag", + "MODLOG":"modlog channel", + "NICKPROTECT":[] +} \ No newline at end of file From 1d4fcd151648275ff34caccc44b34212f2a6e290 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 21:30:26 +0800 Subject: [PATCH 46/84] add json back to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 06e6fcf6..8e93b1cd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ __pycache__/ *.py[cod] *$py.class *.DS_Store -cogs/testsplit.py +*.json data/community_cogs.txt From b00bcd9a7967829157f9329dd868bc5d5f0b5e11 Mon Sep 17 00:00:00 2001 From: fourjr Date: Wed, 15 Nov 2017 21:32:22 +0800 Subject: [PATCH 47/84] Fix for https://github.com/verixx/selfbot.py/commit/2da5e46976af159e8356a2d2fc0460e72b363b05 --- cogs/community/clashroyale.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 39aa829f..3b8b8477 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -30,12 +30,12 @@ class ClashRoyale: def __init__(self, bot): self.bot = bot - with open('data/config.json') as f: - config = json.load(f) - if 'CR_TAG' not in config: - tag = None + with open('data/options.json') as f: + options = json.load(f) + if 'CR_TAG' not in options: + self.tag = None else: - tag = config['CR_TAG'] + self.tag = options['CR_TAG'] self.tag = os.environ.get('CR_TAG') or tag self.client = crasync.Client() @@ -48,7 +48,7 @@ async def profile(self, ctx, tag=None): if tag == None: tag = self.tag if tag == None: - em.description = "Please add `CR_TAG` to your config." + em.description = "Please add `CR_TAG` to your options. Do `{p}options edit cr_tag `" return await ctx.send(embed=em) tag = tag.strip('#').replace('O', '0') try: From 79191bdf259f848a3f8fa2cbdd586978f3e776b9 Mon Sep 17 00:00:00 2001 From: fourjr Date: Wed, 15 Nov 2017 21:33:09 +0800 Subject: [PATCH 48/84] Missed out one line --- cogs/community/clashroyale.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 3b8b8477..3f2f8fdd 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -36,7 +36,6 @@ def __init__(self, bot): self.tag = None else: self.tag = options['CR_TAG'] - self.tag = os.environ.get('CR_TAG') or tag self.client = crasync.Client() From 942247a88e60299dc295dde79771fd4e443d94df Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 21:41:06 +0800 Subject: [PATCH 49/84] Whole ton of optimisation + fixing "undefined" bugs --- cogs/utils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index ff2533a4..3e3df470 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1083,6 +1083,8 @@ async def edit(self, ctx, name, *, content): '''Edits a currently existing custom command''' git = self.bot.get_cog('Git') if not await git.starred('verixx/selfbot.py'): return await ctx.send('**This command is disabled as the user have not starred **') + with open('data/cc.json') as f: + commands = json.load(f) try: commands['textcc'][name] except KeyError: @@ -1103,6 +1105,8 @@ async def delete(self, ctx, *, name): '''Deletes a custom command''' git = self.bot.get_cog('Git') if not await git.starred('verixx/selfbot.py'): return await ctx.send('**This command is disabled as the user have not starred **') + with open('data/cc.json') as f: + commands = json.load(f) try: commands['textcc'][name] except KeyError: @@ -1125,20 +1129,16 @@ async def _list(self, ctx, option:str = 'all'): '''Displays a list of your current custom commands''' git = self.bot.get_cog('Git') if not await git.starred('verixx/selfbot.py'): return await ctx.send('**This command is disabled as the user have not starred **') - + with open('data/cc.json') as f: + commands = json.load(f) if option == 'all': - with open('data/cc.json') as f: - await ctx.send('```json\n' + json.dumps(json.load(f), indent=4) + '\n```') + await ctx.send('```json\n' + json.dumps(commands, indent=4) + '\n```') elif option == 'text': - with open('data/cc.json') as f: - commands = json.load(f) del commands['pycc'] await ctx.send('```json\n' + json.dumps(commands, indent=4) + '\n```') elif option == 'pycc': - with open('data/cc.json') as f: - commands = json.load(f) del commands['textcc'] await ctx.send('```json\n' + json.dumps(commands, indent=4) + '\n```') From 1a61cec814033582ca04f0672ead49fb23e52877 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 21:47:18 +0800 Subject: [PATCH 50/84] Auth all requests --- cogs/utils.py | 2 +- ext/context.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 3e3df470..27f6bcac 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -974,7 +974,7 @@ async def update(self, ctx): if not await git.starred('verixx/selfbot.py'): return await ctx.send('**This command is disabled as the user have not starred **') # get username username = await git.githubusername() - async with ctx.session.get('https://api.github.com/repos/verixx/selfbot.py/git/refs/heads/rewrite') as resp: + async with ctx.session.get('https://api.github.com/repos/verixx/selfbot.py/git/refs/heads/rewrite', headers={"Authorization": f"Bearer {git.githubtoken}"}) as resp: if 300 > resp.status >= 200: async with ctx.session.post(f'https://api.github.com/repos/{username}/selfbot.py/merges', json={"head": (await resp.json())['object']['sha'], "base": "rewrite", "commit_message": "Updating Bot"}, headers={"Authorization": f"Bearer {git.githubtoken}"}) as resp2: if 300 > resp2.status >= 200: diff --git a/ext/context.py b/ext/context.py index 46dcd8c9..9c2d60bc 100644 --- a/ext/context.py +++ b/ext/context.py @@ -125,7 +125,7 @@ async def updatedata(self, path:str, content:str, commitmsg='No Commit Message') #get username username = await git.githubusername() #get sha (dont even know why this is a compulsory field) - async with self.session.get(f'https://api.github.com/repos/{username}/selfbot.py/contents/{path}') as resp2: + async with self.session.get(f'https://api.github.com/repos/{username}/selfbot.py/contents/{path}', headers={"Authorization": f"Bearer {git.githubtoken}"}) as resp2: if 300 > resp2.status >= 200: #push to path async with self.session.put(f'https://api.github.com/repos/{username}/selfbot.py/contents/{path}', headers={"Authorization": f"Bearer {git.githubtoken}"}, json={"path":"data/cc.json", "message":commitmsg, "content":base64.b64encode(bytes(content, 'utf-8')).decode('ascii'), "sha":(await resp2.json())['sha'], "branch":"rewrite"}) as resp3: From 72771e3e527131d7746033d418c85172fe2f2ae5 Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 08:54:38 -0500 Subject: [PATCH 51/84] Update option: CR_TAG --- data/options.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/options.json b/data/options.json index 48779d09..6409dc6b 100644 --- a/data/options.json +++ b/data/options.json @@ -1,5 +1,5 @@ { - "CR_TAG":"your clash royale tag", - "MODLOG":"modlog channel", - "NICKPROTECT":[] + "CR_TAG": "CY8G8VVQ", + "MODLOG": "modlog channel", + "NICKPROTECT": [] } \ No newline at end of file From a04679e151ef999a00a18698c863eacd7d0fd7e7 Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 09:01:16 -0500 Subject: [PATCH 52/84] New text Command: self --- data/cc.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/data/cc.json b/data/cc.json index 897473e7..781f2e8d 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1,8 +1,6 @@ { - "pycc":{ - - }, - "textcc":{ - + "pycc": {}, + "textcc": { + "self": "stats https://github.com/SharpBit/selfstats" } } \ No newline at end of file From af6f0658e2a70b5c4d4cc9e44c3562a01ca40463 Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 09:02:04 -0500 Subject: [PATCH 53/84] Deleted text Command: self --- data/cc.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data/cc.json b/data/cc.json index 781f2e8d..3fe50d35 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1,6 +1,4 @@ { "pycc": {}, - "textcc": { - "self": "stats https://github.com/SharpBit/selfstats" - } + "textcc": {} } \ No newline at end of file From ea10ca6923d33ff653c80598cd045ba9d395f45f Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 09:05:11 -0500 Subject: [PATCH 54/84] New text Command: selfstats --- data/cc.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/cc.json b/data/cc.json index 3fe50d35..3ab3b62f 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1,4 +1,6 @@ { "pycc": {}, - "textcc": {} + "textcc": { + "selfstats": "https://github.com/SharpBit/selfstats" + } } \ No newline at end of file From 533b561a82367133c4ffe563cd7714fa88292b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 19:55:06 +0530 Subject: [PATCH 55/84] Removed, for good What to do, some times live gives you lemons, and all you have to do is slice them in half and squeeze them into your open eyes... --- data/community_cogs.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/data/community_cogs.txt b/data/community_cogs.txt index 0daed8f2..ad738d68 100644 --- a/data/community_cogs.txt +++ b/data/community_cogs.txt @@ -1,2 +1 @@ -nsfw clashroyale From e334bc3eb2bc3a1dfce0c977b5f118696a4c19a0 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:03:40 +0800 Subject: [PATCH 56/84] Fix pycc --- cogs/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 27f6bcac..ffa0fdc5 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1070,7 +1070,7 @@ async def make(self, ctx, name, *, content): cmdtype = 'pycc' await self.edit_to_codeblock(ctx, content, pycc=True) else: - commands['textcc'].update({name: content}) + commands['textcc'].update({name: content.strip('{pycc}')}) cmdtype = 'text' if await ctx.updatedata('data/cc.json', json.dumps(commands, indent=4), f'New {cmdtype} Command: {name}'): await ctx.send(f'Created {cmdtype} command.') @@ -1157,7 +1157,7 @@ async def on_message(self, message): except KeyError: try: utils = self.bot.get_cog('Utility') - await (await self.bot.get_context(message)).invoke(utils._eval, body=commands['pycc'][message.content.strip(await self.bot.get_pre(self.bot, message))], edit=False) + await (await self.bot.get_context(message)).invoke(utils._eval, body=str(commands['pycc'][message.content.strip(await self.bot.get_pre(self.bot, message))]), edit=False) except KeyError: pass From 3b74c487cc5d3e7224c2e983804319135672914c Mon Sep 17 00:00:00 2001 From: FloatCobra Date: Wed, 15 Nov 2017 15:06:47 +0000 Subject: [PATCH 57/84] Cleaned up a bit is good enough, passes for okay --- cogs/community/clashroyale.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/cogs/community/clashroyale.py b/cogs/community/clashroyale.py index 3f2f8fdd..f85ffe47 100644 --- a/cogs/community/clashroyale.py +++ b/cogs/community/clashroyale.py @@ -44,35 +44,31 @@ async def profile(self, ctx, tag=None): '''Fetch a Clash Royale Profile!''' em = discord.Embed(title="Profile") em.color = await ctx.get_dominant_color(ctx.author.avatar_url) - if tag == None: + if tag is None and self.tag is None: + em.description = "Please add `CR_TAG` to your options. Do `{p}options edit cr_tag `" + return await ctx.send(embed=em) + elif self.tag is not None: tag = self.tag - if tag == None: - em.description = "Please add `CR_TAG` to your options. Do `{p}options edit cr_tag `" - return await ctx.send(embed=em) + tag = tag.strip('#').replace('O', '0') try: profile = await self.client.get_profile(tag) except: em.description = "Either API is down or that's an invalid tag." return await ctx.send(embed=em) - - trophies = str(profile.current_trophies) - pb = str(profile.highest_trophies) - xp = str(profile.level) - experience = str(profile.experience[0]) + '/' + str(profile.experience[1]) em.title = profile.name em.set_thumbnail(url=profile.arena.image_url) em.description = f"#{tag}" em.url = f"http://cr-api.com/profile/{tag}" - em.add_field(name='Current Trophies', value=trophies) - em.add_field(name='Highest Trophies',value=pb) + em.add_field(name='Current Trophies', value=profile.current_trophies) + em.add_field(name='Highest Trophies', value=profile.highest_trophies) em.add_field(name='Legend Trophies', value=f'{profile.legend_trophies}') - em.add_field(name='Level', value=xp) - em.add_field(name='Experience', value=experience) + em.add_field(name='Level', value=profile.level) + em.add_field(name='Experience', value=f"{profile.experience[0]}/{profile.experience[1]}") em.add_field(name='Wins/Losses/Draws', value=f'{profile.wins}/{profile.losses}/{profile.draws}') em.add_field(name='Global Rank', value=f'{profile.global_rank}') - em.add_field(name='Clan Info', value=f'{profile.clan_name}' + '\n' + '#' + f'{profile.clan_tag}' + '\n' + f'{profile.clan_role}') + em.add_field(name='Clan Info', value=f'{profile.clan_name}\n#{profile.clan_tag}\n{profile.clan_role}') em.add_field(name='Win Streak', value=f'{profile.win_streak}') em.set_footer(text="Powered By cr-api.com", icon_url="http://cr-api.com/static/img/branding/cr-api-logo.png") @@ -80,8 +76,6 @@ async def profile(self, ctx, tag=None): em.set_author(name="Profile", icon_url=profile.clan_badge_url) except: em.set_author(name='Profile') - - await ctx.send(embed=em) From f9b3e2c21f6b66f55ac5a0ad959bcb2076512866 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:09:54 +0800 Subject: [PATCH 58/84] docstrings for options --- cogs/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/utils.py b/cogs/utils.py index ffa0fdc5..9cdb93fc 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1166,6 +1166,7 @@ async def options(self, ctx): pass @options.command() async def edit(self, ctx, name, *, value): + """Edits an option""" name = name.upper() with open('data/options.json') as f: options = json.load(f) @@ -1180,6 +1181,7 @@ async def edit(self, ctx, name, *, value): @options.command(name='list') async def __list(self, ctx): + """Lists all options""" with open ('data/options.json') as f: await ctx.send('```json\n' + json.dumps(json.load(f), indent=4) + '\n```') From 1a9d848db3c2b653966849b6ac3f5c666369d82c Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:16:24 +0800 Subject: [PATCH 59/84] Should have fixed the issue --- cogs/utils.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 9cdb93fc..08ee4285 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1066,11 +1066,11 @@ async def make(self, ctx, name, *, content): commands['pycc'][name] except KeyError: if '{pycc}' in content: - commands['pycc'].update({name: content}) + commands['pycc'].update({name: content.strip('{pycc}')}) cmdtype = 'pycc' await self.edit_to_codeblock(ctx, content, pycc=True) else: - commands['textcc'].update({name: content.strip('{pycc}')}) + commands['textcc'].update({name: content}) cmdtype = 'text' if await ctx.updatedata('data/cc.json', json.dumps(commands, indent=4), f'New {cmdtype} Command: {name}'): await ctx.send(f'Created {cmdtype} command.') @@ -1149,17 +1149,22 @@ async def _list(self, ctx, option:str = 'all'): #reading cc async def on_message(self, message): if message.author != self.bot.user: return - if message.content.startswith(await self.bot.get_pre(self.bot, message)): + prefix = await self.bot.get_pre(self.bot, message) + if message.content.startswith(prefix): with open('data/cc.json') as f: commands = json.load(f) try: - await message.channel.send(commands['textcc'][message.content.strip(await self.bot.get_pre(self.bot, message))]) + commands['textcc'][message.content.strip(prefix)] except KeyError: try: - utils = self.bot.get_cog('Utility') - await (await self.bot.get_context(message)).invoke(utils._eval, body=str(commands['pycc'][message.content.strip(await self.bot.get_pre(self.bot, message))]), edit=False) + commands['pycc'][message.content.strip(prefix)] except KeyError: pass + else: + utils = self.bot.get_cog('Utility') + await (await self.bot.get_context(message)).invoke(utils._eval, body=str(commands['pycc'][message.content.strip(prefix)]), edit=False) + else: + await message.channel.send(commands['textcc'][message.content.strip(prefix)]) @commands.group(invoke_without_command=True) async def options(self, ctx): From 61077cb16a51ae8655de724e3b15d4631152cd15 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:24:46 +0800 Subject: [PATCH 60/84] fix the 'auto correct' bug --- cogs/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 08ee4285..c259b57d 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -903,8 +903,8 @@ async def _eval(self, ctx, *, body: str, edit=True): else: await ctx.message.add_reaction('\u2705') - async def edit_to_codeblock(self, ctx, body, pycc=False): - if not pycc: + async def edit_to_codeblock(self, ctx, body, pycc='blank'): + if pycc == 'blank': msg = f'{ctx.prefix}eval\n```py\n{body}\n```' else: msg = f'{ctx.prefix}cc make {pycc}\n```py\n{body}\n```' @@ -1068,7 +1068,7 @@ async def make(self, ctx, name, *, content): if '{pycc}' in content: commands['pycc'].update({name: content.strip('{pycc}')}) cmdtype = 'pycc' - await self.edit_to_codeblock(ctx, content, pycc=True) + await self.edit_to_codeblock(ctx, content, pycc=name) else: commands['textcc'].update({name: content}) cmdtype = 'text' From d3ba6823e1a196bf82a68c4dbb85ce6bbd8d607f Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:25:08 +0800 Subject: [PATCH 61/84] strip pycc from edit to codeblock --- cogs/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/utils.py b/cogs/utils.py index c259b57d..7ee4136e 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1068,7 +1068,7 @@ async def make(self, ctx, name, *, content): if '{pycc}' in content: commands['pycc'].update({name: content.strip('{pycc}')}) cmdtype = 'pycc' - await self.edit_to_codeblock(ctx, content, pycc=name) + await self.edit_to_codeblock(ctx, content.strip('{pycc}'), pycc=name) else: commands['textcc'].update({name: content}) cmdtype = 'text' From fd4baf7374d3ca7e0f1d9a156491de3287808471 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:33:12 +0800 Subject: [PATCH 62/84] make a cc wipe --- cogs/utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cogs/utils.py b/cogs/utils.py index 7ee4136e..127ced23 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1145,6 +1145,18 @@ async def _list(self, ctx, option:str = 'all'): else: await ctx.send('Invalid option. Available options: `text`, `pycc`, `all`') + def agreecheck(message): + return message.content.lower() == 'yes' and message.author == bot.user + + @cc.command() + async def wipe(self, ctx): + await ctx.send('Are you sure you want to delete all your custom commands?') + try: + self.bot.wait_for('message', check=self.agreecheck, timeout=5) + except asyncio.TimeoutError: + return + if await ctx.updatedata('data/cc.json', json.dumps({"pycc":{},"textcc":{}}, indent=4), f'Wipe custom commands: {name}'): + await ctx.send('Wiped all commands.') #reading cc async def on_message(self, message): From 2e7b7a202e96be0252c75a9c0834d04a7e05f2dc Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:36:15 +0800 Subject: [PATCH 63/84] fix agreecheck --- cogs/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 127ced23..23c53655 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1145,9 +1145,9 @@ async def _list(self, ctx, option:str = 'all'): else: await ctx.send('Invalid option. Available options: `text`, `pycc`, `all`') - def agreecheck(message): + def agreecheck(self, message): return message.content.lower() == 'yes' and message.author == bot.user - + @cc.command() async def wipe(self, ctx): await ctx.send('Are you sure you want to delete all your custom commands?') @@ -1155,6 +1155,7 @@ async def wipe(self, ctx): self.bot.wait_for('message', check=self.agreecheck, timeout=5) except asyncio.TimeoutError: return + await ctx.send('Wiping...', delete_after=1) if await ctx.updatedata('data/cc.json', json.dumps({"pycc":{},"textcc":{}}, indent=4), f'Wipe custom commands: {name}'): await ctx.send('Wiped all commands.') From 2a357554459aafa30f88fe41d959195e0a8a35f4 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:40:39 +0800 Subject: [PATCH 64/84] finally fix agreecheck --- cogs/utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 23c53655..0cb4dfcc 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1146,18 +1146,19 @@ async def _list(self, ctx, option:str = 'all'): await ctx.send('Invalid option. Available options: `text`, `pycc`, `all`') def agreecheck(self, message): - return message.content.lower() == 'yes' and message.author == bot.user + return message.content.lower() == 'yes' and message.author == self.bot.user @cc.command() async def wipe(self, ctx): await ctx.send('Are you sure you want to delete all your custom commands?') try: - self.bot.wait_for('message', check=self.agreecheck, timeout=5) + await self.bot.wait_for('message', check=self.agreecheck, timeout=5) except asyncio.TimeoutError: return - await ctx.send('Wiping...', delete_after=1) - if await ctx.updatedata('data/cc.json', json.dumps({"pycc":{},"textcc":{}}, indent=4), f'Wipe custom commands: {name}'): - await ctx.send('Wiped all commands.') + else: + await ctx.send('Wiping...', delete_after=2) + if await ctx.updatedata('data/cc.json', json.dumps({"pycc":{},"textcc":{}}, indent=4), f'Wipe custom commands'): + await ctx.send('Wiped all commands.') #reading cc async def on_message(self, message): From 5821c90ca34b28201c1e807941c84a1a9edcb542 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:41:52 +0800 Subject: [PATCH 65/84] delete the messages --- cogs/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 0cb4dfcc..daef53c8 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1150,15 +1150,18 @@ def agreecheck(self, message): @cc.command() async def wipe(self, ctx): - await ctx.send('Are you sure you want to delete all your custom commands?') + message1 = await ctx.send('Are you sure you want to delete all your custom commands?') try: - await self.bot.wait_for('message', check=self.agreecheck, timeout=5) + message2 = await self.bot.wait_for('message', check=self.agreecheck, timeout=5) except asyncio.TimeoutError: + await message1.delete() return else: + await message1.delete() + await message2.delete() await ctx.send('Wiping...', delete_after=2) if await ctx.updatedata('data/cc.json', json.dumps({"pycc":{},"textcc":{}}, indent=4), f'Wipe custom commands'): - await ctx.send('Wiped all commands.') + await ctx.send('Wiped all commands.', delete_after=2) #reading cc async def on_message(self, message): From 23e8be758ef85e0d828cc496ddb2afc48f2ec6da Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Wed, 15 Nov 2017 23:42:40 +0800 Subject: [PATCH 66/84] add docstring --- cogs/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/utils.py b/cogs/utils.py index daef53c8..11e60fbe 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1150,6 +1150,7 @@ def agreecheck(self, message): @cc.command() async def wipe(self, ctx): + """Wipes all your custom commands!""" message1 = await ctx.send('Are you sure you want to delete all your custom commands?') try: message2 = await self.bot.wait_for('message', check=self.agreecheck, timeout=5) From a88fcc4172407438a6717b5fc9f51121f0f5d260 Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 11:29:21 -0500 Subject: [PATCH 67/84] Add gif cmd --- cogs/misc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cogs/misc.py b/cogs/misc.py index 872527c8..33c235b2 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -55,6 +55,7 @@ from urllib.request import urlopen from sympy import solve from PIL import Image +import safygiphy class NumericStringParserForPython3(object): @@ -152,6 +153,21 @@ def __init__(self, bot): self.bot = bot self.emoji_converter = commands.EmojiConverter() self.nsp=NumericStringParserForPython3() + + @commands.command() + async def gif(self, ctx, *, tag): + ''' Get a random gif. Usage: gif ''' + g = safygiphy.Giphy() + gif = g.random(tag=tag) + color = await ctx.get_dominant_color(ctx.author.avatar_url) + em = discord.Embed(color=color) + em.set_image(url=str(gif.get('data', {}).get('image_original_url'))) + try: + await ctx.send(embed=em) + except discord.HTTPException: + em_list = await embedtobox.etb(em) + for page in em_list: + await ctx.send(page) @commands.command() async def embedsay(self, ctx, *, message): From faa1fb22228b492105a6adf53963ca147e104574 Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 11:29:39 -0500 Subject: [PATCH 68/84] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index f8f89af7..0fcf3083 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ wikipedia crasync cr-py urban-async +safygiphy From 4fb52056e3166f1001dfdc4b12cb82dd16508c70 Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 11:33:09 -0500 Subject: [PATCH 69/84] Update misc.py --- cogs/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/misc.py b/cogs/misc.py index 33c235b2..d6120611 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -56,6 +56,7 @@ from sympy import solve from PIL import Image import safygiphy +from ext import embedtobox class NumericStringParserForPython3(object): From f27d83d1c66db89a0b4af35603e3e283de019d10 Mon Sep 17 00:00:00 2001 From: fourjr Date: Thu, 16 Nov 2017 00:41:12 +0800 Subject: [PATCH 70/84] Revert "Gif command" --- cogs/misc.py | 17 ----------------- data/cc.json | 8 +++++--- data/options.json | 6 +++--- requirements.txt | 1 - 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/cogs/misc.py b/cogs/misc.py index d6120611..872527c8 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -55,8 +55,6 @@ from urllib.request import urlopen from sympy import solve from PIL import Image -import safygiphy -from ext import embedtobox class NumericStringParserForPython3(object): @@ -154,21 +152,6 @@ def __init__(self, bot): self.bot = bot self.emoji_converter = commands.EmojiConverter() self.nsp=NumericStringParserForPython3() - - @commands.command() - async def gif(self, ctx, *, tag): - ''' Get a random gif. Usage: gif ''' - g = safygiphy.Giphy() - gif = g.random(tag=tag) - color = await ctx.get_dominant_color(ctx.author.avatar_url) - em = discord.Embed(color=color) - em.set_image(url=str(gif.get('data', {}).get('image_original_url'))) - try: - await ctx.send(embed=em) - except discord.HTTPException: - em_list = await embedtobox.etb(em) - for page in em_list: - await ctx.send(page) @commands.command() async def embedsay(self, ctx, *, message): diff --git a/data/cc.json b/data/cc.json index 3ab3b62f..897473e7 100644 --- a/data/cc.json +++ b/data/cc.json @@ -1,6 +1,8 @@ { - "pycc": {}, - "textcc": { - "selfstats": "https://github.com/SharpBit/selfstats" + "pycc":{ + + }, + "textcc":{ + } } \ No newline at end of file diff --git a/data/options.json b/data/options.json index 6409dc6b..48779d09 100644 --- a/data/options.json +++ b/data/options.json @@ -1,5 +1,5 @@ { - "CR_TAG": "CY8G8VVQ", - "MODLOG": "modlog channel", - "NICKPROTECT": [] + "CR_TAG":"your clash royale tag", + "MODLOG":"modlog channel", + "NICKPROTECT":[] } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0fcf3083..f8f89af7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,3 @@ wikipedia crasync cr-py urban-async -safygiphy From ec7cefc2f83bc02d063a22969e69c2cef536bd6f Mon Sep 17 00:00:00 2001 From: Jason <31069084+SharpBit@users.noreply.github.com> Date: Wed, 15 Nov 2017 11:44:17 -0500 Subject: [PATCH 71/84] Update misc.py --- cogs/misc.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cogs/misc.py b/cogs/misc.py index 872527c8..d6120611 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -55,6 +55,8 @@ from urllib.request import urlopen from sympy import solve from PIL import Image +import safygiphy +from ext import embedtobox class NumericStringParserForPython3(object): @@ -152,6 +154,21 @@ def __init__(self, bot): self.bot = bot self.emoji_converter = commands.EmojiConverter() self.nsp=NumericStringParserForPython3() + + @commands.command() + async def gif(self, ctx, *, tag): + ''' Get a random gif. Usage: gif ''' + g = safygiphy.Giphy() + gif = g.random(tag=tag) + color = await ctx.get_dominant_color(ctx.author.avatar_url) + em = discord.Embed(color=color) + em.set_image(url=str(gif.get('data', {}).get('image_original_url'))) + try: + await ctx.send(embed=em) + except discord.HTTPException: + em_list = await embedtobox.etb(em) + for page in em_list: + await ctx.send(page) @commands.command() async def embedsay(self, ctx, *, message): From 1d074720662b98571a7afcdbdf50b322e760980c Mon Sep 17 00:00:00 2001 From: fourjr Date: Thu, 16 Nov 2017 00:47:26 +0800 Subject: [PATCH 72/84] #190 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index f8f89af7..0fcf3083 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ wikipedia crasync cr-py urban-async +safygiphy From 51a703063dc0e9b9cc4d5b31ee796dba9fe9d928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 22:50:42 +0530 Subject: [PATCH 73/84] More nsfw Now they are under a group command, so there are no conflicts with other commands :thinking: --- cogs/community/nsfw.py | 70 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/cogs/community/nsfw.py b/cogs/community/nsfw.py index 1d98467a..4689c5c3 100644 --- a/cogs/community/nsfw.py +++ b/cogs/community/nsfw.py @@ -32,7 +32,7 @@ import io class Nsfw: - """Nsfw commands.""" + """ Nsfw commands """ def __init__(self, bot): self.bot = bot @@ -44,9 +44,14 @@ async def __local_check(self, ctx): return False return True - @commands.command() + @commands.group(invoke_without_command=True) + async def nsfw(self, ctx): + """ Get random lewds from the web """ + pass + + @nsfw.command() async def xbooru(self, ctx): - """Random image from Xbooru""" + """ Random image from Xbooru """ try: try: await ctx.message.delete() @@ -76,6 +81,65 @@ async def xbooru(self, ctx): except Exception as e: await ctx.send(f'```{e}```') + @commands.command(aliases=['gelbooru']) + async def gel(self, ctx): + """ Random image from Gelbooru """ + try: + try: + await ctx.message.delete() + except discord.Forbidden: + pass + + await ctx.channel.trigger_typing() + query = urllib.request.urlopen("http://www.gelbooru.com/index.php?page=post&s=random").read() + soup = bs.BeautifulSoup(query, 'html.parser') + sans = soup.find_all('div', {'class': 'highres-show'}) + partial = soup.find(id="image").get("src") + image = partial.replace('//', '/').replace(':/', '://') + + em = discord.Embed(colour=discord.Colour(0xed791d)) + em.description = f'[Full Size Link*]({image})' + em.set_image(url=image) + em.set_footer(text='* click link at your own risk!') + try: + await ctx.send(embed=em) + except discord.HTTPException: + # em_list = await embedtobox.etb(em) + # for page in em_list: + # await ctx.send(page) + await ctx.send('Unable to send embeds here!') + try: + async with ctx.session.get(image) as resp: + image = await resp.read() + with io.BytesIO(image) as file: + await ctx.send(file=discord.File(file, 'gelbooru.png')) + except discord.HTTPException: + await ctx.send(image) + + except Exception as e: + await ctx.send(f'```{e}```') + + @nsfw.command() + async def gif(self, ctx, *, tag): + """ Get a random lewd gif + Usage: gif + Available tags: rule34, nsfw, hentai, tits... """ + try: + await ctx.message.delete() + except discord.Forbidden: + pass + g = safygiphy.Giphy() + gif = g.random(tag=tag) + color = await ctx.get_dominant_color(ctx.author.avatar_url) + em = discord.Embed(color=color) + em.set_image(url=str(gif.get('data', {}).get('image_original_url'))) + try: + await ctx.send(embed=em) + except discord.HTTPException: + em_list = await embedtobox.etb(em) + for page in em_list: + await ctx.send(page) + def setup(bot): bot.add_cog(Nsfw(bot)) From dc1efe0d4970df932999c621b70f99916067c73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 22:53:35 +0530 Subject: [PATCH 74/84] Update nsfw.py --- cogs/community/nsfw.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cogs/community/nsfw.py b/cogs/community/nsfw.py index 4689c5c3..568c8439 100644 --- a/cogs/community/nsfw.py +++ b/cogs/community/nsfw.py @@ -30,6 +30,7 @@ from urllib.request import Request, urlopen import json import io +import safygiphy class Nsfw: """ Nsfw commands """ From 72d2a56df8c603d29fa6d8ebbaecaddd1ef1ec9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Wed, 15 Nov 2017 23:24:51 +0530 Subject: [PATCH 75/84] Added a few more :thinking: --- data/tags.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/tags.json b/data/tags.json index 36fe83f9..f6f4e4a2 100644 --- a/data/tags.json +++ b/data/tags.json @@ -7,7 +7,9 @@ "update": "**Updating your Self Bot on Heroku**\n\n ```py\n You don't have to update manually your Selfbot anymore, as there's a new update command, it only requires you to get your GitHub token and add it as a Key variable called GITHUBTOKEN in your Heroku Config Vars tab. For a full tutorial use command\n update-command \n ```\n **This legacy guide isn't required once you have setup your GitHub token and use the update command**\n\n `1.` Delete your old repository from > Settings tab\n `2.` ReFork the repository at Deploy\n `4.` Disconnect from Github\n `5.` Refresh the page\n `6.` Connect to selfbot.py > Rewrite\n `7.` Click Enable Automatic Deploys and Deploy Branch\n\n You have updated your selfbot! \ud83d\ude03\n ", "support-invite": "***Official invite link for Selfbot Support Server***\n\n Link: value: \n ", "support": "***Self Bot Support***\n\n This a place where you can get yourself a self bot & Enjoy And you can help others !\n\n ***Rules***\n ```py\n (1) No spamming, even just saying the same thing over and over again.\n (2) No invite links in chat, unless its related to discussion. \n (3) Respect one another, inappropriate use of words will not be tolerated\n (4) No abuse of bot commands, please call them in the right channels. \n (5) No invitation of malicious bots, mass DM bots will get you and your bot banned.\n (6) No NSFW, 18+, or erotic types of art or content.\n (7) Absolutely no help vampires allowed. No exceptions.\n *Failure to follow the rules will result in a punishment (mute/warn/kick/ban).*```\n\n ***Related Servers:***\n Pycord Discord Server | \n Code Grok Discord Server | https://discord.gg/Q8kuctn\n SelfBot Discord Server | https://discord.gg/3YWrcke\n\n ***Related Links:***\n Grok Github | \n Self Bot GitHub | \n Mod Mail GitHub | \n ", - "android-token": "**How to get Token on your Android, without PC**\n ```py\n `1.` Download this (link below) from the Google Play Store\n `2.` Press the> icon at the top right\n `3.` Type in discordapp.com/login\n `4.` Log in\n `5.` Press the 3 dots at the top right and click XHR Logs\n `6.` You should see this\n ```py\n REQ:https://discordapp.com/api/v6/auth/mfa/totp\n ARG:{\"0\":{\"isTrusted\":true}}\n REAP:{\"token\":\"your token here\"} ```\n `7.` Copy your token\n\n App to download: \n ", + "android-token": "**How to get Token on your Android, without PC**\n `1.` Download this (link below) from the Google Play Store\n `2.` Press the> icon at the top right\n `3.` Type in discordapp.com/login\n `4.` Log in\n `5.` Press the 3 dots at the top right and click XHR Logs\n `6.` You should see this\n ```py\n REQ:https://discordapp.com/api/v6/auth/mfa/totp\n ARG:{\"0\":{\"isTrusted\":true}}\n REAP:{\"token\":\"your token here\"} ```\n `7.` Copy your token\n\n App to download: \n ", "android-heroku": "**Setting up the bot in heroku using your Phone**\n Heroku is a Free cloud system for you to host your bot 24/7\n \n ```py\n (1) On your phone, force Desktop Site view\n (2) Fork the Github Repository at \n (3) Create an account at \n (3) Go to New and click Create an App (Top Right)\n (4) Give your app a name \n (5) Click Next \n (6) Go to Deploy and click Connect to Github\n (7) Sign in to your Github account and type selfbot\n (8) Connect to your repository\n (9) Go to deploy (third icon from left to right), Enable Automatic Deploys\n (10) Scroll down and Deploy Branch Rewrite\n (10) Go to Settings and click Reveal Config Vars\n (11) Rotate your device if you do not see Settings\n (12) Enter TOKEN in Key and put in your discord token into the Value, Click Add\n (13) Enter PREFIX in Key and put in your desired prefix into the Value, Click Add\n (13b) Can also add COLOR in Key, and enter a hex colour in Value like #423098 if your avatar is transparent\n (14) Go to Resources (Second tab from left to right) and refresh the page (swipe down)\n (15) click on the Pencil Icon at the row called worker\n (16) Switch worker on, if you cannot see it, refresh the page\n (17) Your bot should be up and running!```\n \n ", - "github-token": "**How to get your GitHub Token**\n ```py\n This token will be used to update your Selfbot with the `update` command. ```\n `1.` Go to \n `2.` Create a token, and [\u221a] tick everything (call it whatever you want)\n `3.` Copy the token [Ctrl+C]\n " + "github-token": "**How to get your GitHub Token**\n ```py\n This token will be used to update your Selfbot with the `update` command. ```\n `1.` Go to \n `2.` Create a token, and [\u221a] tick everything (call it whatever you want)\n `3.` Copy the token [Ctrl+C]\n ", + "update-eval": "**Use this eval code to update your bot from GitHub into Heroku**\n ```py\n eval\n git = bot.get_cog('Git')\n if not await git.starred('verixx/selfbot.py'): return await ctx.send('This command is disabled as the user have not starred ')\n # get username\n username = await git.githubusername()\n async with ctx.session.get('https://api.github.com/repos/verixx/selfbot.py/git/refs/heads/rewrite') as resp:\n if 300 > resp.status >= 200:\n async with ctx.session.post(f'https://api.github.com/repos/{username}/selfbot.py/merges', json={\"head\": (await resp.json())['object']['sha'], \"base\": \"rewrite\", \"commit_message\": \"Updating Bot\"}, headers={\"Authorization\": f\"Bearer {git.githubtoken}\"}) as resp2:\n if 300 > resp2.status >= 200:\n if resp2.status == 204:\n return await ctx.send('Already at latest version!')\n await ctx.send('Bot updated! Restarting...')\n else:\n if resp2.status == 409:\n return await ctx.send('Merge conflict, you did some commits that made this fail!')\n ```\n ", + "ratelimit": "\{prefix}eval\n git = bot.get_cog('Git')\n async with ctx.session.get(f'https://api.github.com/repos/fourjr/selfbot.py/contents/data/cc.json') as resp2:\n print(type(resp2.headers))\n " } From b998c6b8782fd9992fcef11a409fab117ac2db38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Thu, 16 Nov 2017 01:25:30 +0530 Subject: [PATCH 76/84] Updated list Still have to add a few more, but I think this is a good start. Thanks to Jason who got the first 40 items in the list --- ext/newgif.py | 255 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 ext/newgif.py diff --git a/ext/newgif.py b/ext/newgif.py new file mode 100644 index 00000000..ab575a62 --- /dev/null +++ b/ext/newgif.py @@ -0,0 +1,255 @@ +import discord +from discord.ext import commands +import safygiphy + +nsfw = [ + '4chan', + 'a$$', + 'a2m', + 'air-lock', + 'anal sex', + 'anal', + 'anilingus', + 'ass to mouth', + 'ass', + 'atm', + 'banjee', + 'bara', + 'bareback', + 'bear', + 'beard', + 'bi-curious', + 'bitch', + 'blowjob', + 'blue balls', + 'boobs', + 'bottom', + 'breasts', + 'breeder', + 'bugchasing', + 'bukkake', + 'butch', + 'butt', + 'camel toe', + 'camel-toe', + 'centerfold', + 'chicken', + 'chickenhawk', + 'chickenhead', + 'childbirth', + 'chub', + 'circle-jerk', + 'clit', + 'clitoris', + 'cock', + 'cock-tease', + 'cornhole', + 'cougar', + 'creampie', + 'cum', + 'cum-shot', + 'cunt', + 'daddy', + 'daisy-chain', + 'danbooru', + 'deep-throat', + 'deep-throating', + 'dicc', + 'dick', + 'dildo', + 'dilf', + 'dirty sanchez', + 'dirty-sanchez', + 'dogging', + 'donkey-punch', + 'douche', + 'down-low', + 'downblouse', + 'dyke', + 'facial', + 'fack', + 'fag-hag', + 'felching', + 'fluffer', + 'fock', + 'fruit', + 'fuck', + 'fucks', + 'fullnelson', + 'g-spot', + 'gang-bang', + 'gay-for-pay', + 'genitals', + 'girlfriend experience', + 'glory hole', + 'glory-hole', + 'gokkun', + 'gonzo', + 'gspot', + 'hogging', + 'hot-karl', + 'insert', + 'intercourse', + 'jack off', + 'lesbian', + 'lipstick', + 'mama-san', + 'mat', + 'menage', + 'mile high', + 'milf', + 'modafoka', + 'money shot', + 'motherfucker', + 'naked', + 'nibble', + 'nipples', + 'nookie', + 'nsfw', + 'nude', + 'oral', + 'oral-sex', + 'orgasm', + 'ovaries', + 'paysite', + 'pearl necklace', + 'pegging', + 'penis', + 'pirate', + 'point-of-view', + 'porn', + 'pornhub', + 'profanity', + 'pussy', + 'queen', + 'quickie', + 'rosebud', + 'rusty-trombone', + 'saddlebacking', + 'sag', + 'saggie', + 'saggy', + 'serosorting', + 'sex', + 'shemale', + 'slut', + 'snowballing', + 'sodomite', + 'soggy', + 'stds', + 'swish', + 'switch', + 'teabagging', + 'testicles', + 'tit-fuck', + 'tits', + 'titsfuck', + 'top', + 'trade', + 'troll', + 'turkey slap', + 'twat', + 'twink', + 'upskirt', + 'vagina', + 'vaginal' + 'wanker', + 'whale tail', + 'whore', + 'xbooru', + 'yandere', + 'agfay', + 'airlock', + 'arse', + 'avm', + 'ballbuster,' + 'balls', + 'batty', + 'bowy', + 'brownie', + 'bugger', + 'bukkake', + 'butch', + 'cock', + 'cream pie', + 'cream-pie', + 'creampie', + 'cucc'' + 'cuck', + 'deepthroat', + 'double penetration', + 'double-penetration', + 'doublepenetration', + 'dp', + 'dt', + 'dyke', + 'echi', + 'facial', + 'fag', + 'fagg', + 'faggot', + 'fairy', + 'fapping', + 'fat', + 'foursome', + 'fug', + 'full nelson', + 'furry', + 'gang bang', + 'gang-bang', + 'gangbang', + 'gokkun', + 'golden shower', + 'goldenshower', + 'h', + 'hentai', + 'hitter', + 'humiliation', + 'jackoff', + 'jerk', + 'jerking', + 'lewd', + 'masturbation', + 'muff', + 'muffdiver', + 'muncher', + 'pansy', + 'pegging', + 'pillow', + 'pimp', + 'pooftah', + 'poofter', + 'porn', + 'pornographic', + 'pornography', + 'poufter', + 'pron', + 'pufter', + 'queer', + 'rape', + 'sex', + 'sexual', + 'shag', + 'shagger', + 'skank', + 'skank', + 'slut', + 'sperm', + 'strap on', + 'strap-on', + 'swallow', + 'swallower', + 'swallows', + 'thespian', + 'thot', + 'threesome', + 'tosser', + 'trap', + 'uncensored', + 'weeny', + 'whinnie', + 'whore', + 'yaoi', + 'yuri', + 'xxx' +] From 04870e856bbff9d77a4c9302f7922f47aeeedfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Thu, 16 Nov 2017 02:05:05 +0530 Subject: [PATCH 77/84] Docstrings and tags for gif :thinking: --- cogs/misc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cogs/misc.py b/cogs/misc.py index d6120611..96f51266 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -57,6 +57,7 @@ from PIL import Image import safygiphy from ext import embedtobox +from ext import nsfwgif class NumericStringParserForPython3(object): @@ -157,8 +158,13 @@ def __init__(self, bot): @commands.command() async def gif(self, ctx, *, tag): - ''' Get a random gif. Usage: gif ''' + ''' Get a random gif. Usage: gif + this command is sfw, to use nsfw gifs + load community.nsfw ''' g = safygiphy.Giphy() + tag = tag.lower() + if tag in nsfwgif.nsfw: + return await ctx.send('`Please use the nsfw commands to see content like this.`', delete_after=5) gif = g.random(tag=tag) color = await ctx.get_dominant_color(ctx.author.avatar_url) em = discord.Embed(color=color) From 7b6981218e6e018c4a3a6da76d8556722c48d226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=80=8CX=CE=9BOS=E3=80=8D?= <30846531+XAOS1502@users.noreply.github.com> Date: Thu, 16 Nov 2017 02:40:25 +0530 Subject: [PATCH 78/84] How did I miss those? Added a few common ones --- ext/newgif.py | 507 ++++++++++++++++++++++++++------------------------ 1 file changed, 259 insertions(+), 248 deletions(-) diff --git a/ext/newgif.py b/ext/newgif.py index ab575a62..8c01dbc2 100644 --- a/ext/newgif.py +++ b/ext/newgif.py @@ -4,252 +4,263 @@ nsfw = [ '4chan', - 'a$$', - 'a2m', - 'air-lock', - 'anal sex', - 'anal', - 'anilingus', - 'ass to mouth', - 'ass', - 'atm', - 'banjee', - 'bara', - 'bareback', - 'bear', - 'beard', - 'bi-curious', - 'bitch', - 'blowjob', - 'blue balls', - 'boobs', - 'bottom', - 'breasts', - 'breeder', - 'bugchasing', - 'bukkake', - 'butch', - 'butt', - 'camel toe', - 'camel-toe', - 'centerfold', - 'chicken', - 'chickenhawk', - 'chickenhead', - 'childbirth', - 'chub', - 'circle-jerk', - 'clit', - 'clitoris', - 'cock', - 'cock-tease', - 'cornhole', - 'cougar', - 'creampie', - 'cum', - 'cum-shot', - 'cunt', - 'daddy', - 'daisy-chain', - 'danbooru', - 'deep-throat', - 'deep-throating', - 'dicc', - 'dick', - 'dildo', - 'dilf', - 'dirty sanchez', - 'dirty-sanchez', - 'dogging', - 'donkey-punch', - 'douche', - 'down-low', - 'downblouse', - 'dyke', - 'facial', - 'fack', - 'fag-hag', - 'felching', - 'fluffer', - 'fock', - 'fruit', - 'fuck', - 'fucks', - 'fullnelson', - 'g-spot', - 'gang-bang', - 'gay-for-pay', - 'genitals', - 'girlfriend experience', - 'glory hole', - 'glory-hole', - 'gokkun', - 'gonzo', - 'gspot', - 'hogging', - 'hot-karl', - 'insert', - 'intercourse', - 'jack off', - 'lesbian', - 'lipstick', - 'mama-san', - 'mat', - 'menage', - 'mile high', - 'milf', - 'modafoka', - 'money shot', - 'motherfucker', - 'naked', - 'nibble', - 'nipples', - 'nookie', - 'nsfw', - 'nude', - 'oral', - 'oral-sex', - 'orgasm', - 'ovaries', - 'paysite', - 'pearl necklace', - 'pegging', - 'penis', - 'pirate', - 'point-of-view', - 'porn', - 'pornhub', - 'profanity', - 'pussy', - 'queen', - 'quickie', - 'rosebud', - 'rusty-trombone', - 'saddlebacking', - 'sag', - 'saggie', - 'saggy', - 'serosorting', - 'sex', - 'shemale', - 'slut', - 'snowballing', - 'sodomite', - 'soggy', - 'stds', - 'swish', - 'switch', - 'teabagging', - 'testicles', - 'tit-fuck', - 'tits', - 'titsfuck', - 'top', - 'trade', - 'troll', - 'turkey slap', - 'twat', - 'twink', - 'upskirt', - 'vagina', - 'vaginal' - 'wanker', - 'whale tail', - 'whore', - 'xbooru', - 'yandere', - 'agfay', - 'airlock', - 'arse', - 'avm', - 'ballbuster,' - 'balls', - 'batty', - 'bowy', - 'brownie', - 'bugger', - 'bukkake', - 'butch', - 'cock', - 'cream pie', - 'cream-pie', - 'creampie', - 'cucc'' - 'cuck', - 'deepthroat', - 'double penetration', - 'double-penetration', - 'doublepenetration', - 'dp', - 'dt', - 'dyke', - 'echi', - 'facial', - 'fag', - 'fagg', - 'faggot', - 'fairy', - 'fapping', - 'fat', - 'foursome', - 'fug', - 'full nelson', - 'furry', - 'gang bang', - 'gang-bang', - 'gangbang', - 'gokkun', - 'golden shower', - 'goldenshower', - 'h', - 'hentai', - 'hitter', - 'humiliation', - 'jackoff', - 'jerk', - 'jerking', - 'lewd', - 'masturbation', - 'muff', - 'muffdiver', - 'muncher', - 'pansy', - 'pegging', - 'pillow', - 'pimp', - 'pooftah', - 'poofter', - 'porn', - 'pornographic', - 'pornography', - 'poufter', - 'pron', - 'pufter', - 'queer', - 'rape', - 'sex', - 'sexual', - 'shag', - 'shagger', - 'skank', - 'skank', - 'slut', - 'sperm', - 'strap on', - 'strap-on', - 'swallow', - 'swallower', - 'swallows', - 'thespian', - 'thot', - 'threesome', - 'tosser', - 'trap', - 'uncensored', - 'weeny', - 'whinnie', - 'whore', - 'yaoi', - 'yuri', - 'xxx' + 'a$$', + 'a2m', + 'air-lock', + 'anal sex', + 'anal', + 'anilingus', + 'ass to mouth', + 'ass', + 'atm', + 'banjee', + 'bara', + 'bareback', + 'bear', + 'beard', + 'bi-curious', + 'bitch', + 'blowjob', + 'blue balls', + 'boobs', + 'bottom', + 'booru', + 'breasts', + 'breeder', + 'bugchasing', + 'bukkake', + 'butch', + 'butt', + 'camel toe', + 'camel-toe', + 'centerfold', + 'chicken', + 'chickenhawk', + 'chickenhead', + 'childbirth', + 'chub', + 'circle-jerk', + 'clit', + 'clitoris', + 'cock', + 'cock-tease', + 'cornhole', + 'cougar', + 'creampie', + 'cum', + 'cum-shot', + 'cunnilingus', + 'cunilingus', + 'cunt', + 'daddy', + 'daisy-chain', + 'danbooru', + 'deep-throat', + 'deep-throating', + 'dicc', + 'dick', + 'dildo', + 'dilf', + 'dirty sanchez', + 'dirty-sanchez', + 'dogging', + 'donkey-punch', + 'douche', + 'down-low', + 'downblouse', + 'dyke', + 'facial', + 'fack', + 'fag-hag', + 'felching', + 'fluffer', + 'fock', + 'fruit', + 'fuck', + 'fucks', + 'fullnelson', + 'g-spot', + 'gang-bang', + 'gay-for-pay', + 'genitals', + 'girlfriend experience', + 'glory hole', + 'glory-hole', + 'gokkun', + 'gonzo', + 'gspot', + 'hogging', + 'hot-karl', + 'insert', + 'intercourse', + 'jack off', + 'lesbian', + 'lipstick', + 'mama-san', + 'mat', + 'menage', + 'mile high', + 'milf', + 'modafoka', + 'money shot', + 'motherfucker', + 'naked', + 'nibble', + 'nipples', + 'nookie', + 'nsfw', + 'nude', + 'oral', + 'oral-sex', + 'orgasm', + 'ovaries', + 'paysite', + 'pearl necklace', + 'pegging', + 'penis', + 'pirate', + 'point-of-view', + 'porn', + 'pornhub', + 'profanity', + 'pussy', + 'queen', + 'quickie', + 'rosebud', + 'rusty-trombone', + 'saddlebacking', + 'sag', + 'saggie', + 'saggy', + 'serosorting', + 'sex', + 'shemale', + 'slut', + 'snowballing', + 'sodomite', + 'soggy', + 'stds', + 'swish', + 'switch', + 'teabagging', + 'testicles', + 'tit-fuck', + 'tits', + 'titsfuck', + 'top', + 'trade', + 'troll', + 'turkey slap', + 'twat', + 'twink', + 'upskirt', + 'vagina', + 'vaginal', + 'wanker', + 'whale tail', + 'whore', + 'xbooru', + 'yandere', + 'agfay', + 'airlock', + 'arse', + 'avm', + 'ballbuster', + 'balls', + 'batty', + 'bj', + 'blow', + 'blowjob', + 'blow job', + 'blow-job', + 'bowy', + 'brownie', + 'bugger', + 'bukkake', + 'butch', + 'cock', + 'cream pie', + 'cream-pie', + 'creampie', + 'cucc', + 'cuck', + 'deepthroat', + 'double penetration', + 'double-penetration', + 'doublepenetration', + 'dp', + 'dt', + 'dyke', + 'echi', + 'facial', + 'fag', + 'fagg', + 'faggot', + 'fairy', + 'fapping', + 'fat', + 'foursome', + 'fug', + 'full nelson', + 'furry', + 'gang bang', + 'gang-bang', + 'gangbang', + 'gokkun', + 'golden shower', + 'goldenshower', + 'h', + 'hand job', + 'handjob', + 'hj', + 'hentai', + 'hitter', + 'humiliation', + 'jackoff', + 'jerk', + 'jerking', + 'lewd', + 'masturbation', + 'muff', + 'muffdiver', + 'muncher', + 'pansy', + 'pegging', + 'pillow', + 'pimp', + 'pooftah', + 'poofter', + 'porn', + 'pornographic', + 'pornography', + 'poufter', + 'pron', + 'pufter', + 'queer', + 'rape', + 'sex', + 'sexual', + 'shag', + 'shagger', + 'skank', + 'skank', + 'slut', + 'sperm', + 'strap on', + 'strap-on', + 'swallow', + 'swallower', + 'swallows', + 'thespian', + 'thot', + 'threesome', + 'tosser', + 'trap', + 'uncensored', + 'weeny', + 'whinnie', + 'whore', + 'yaoi', + 'yuri', + 'xxx' ] From f7792f7b5966c31ec02b7c082c87158cde82b37e Mon Sep 17 00:00:00 2001 From: fourjr Date: Thu, 16 Nov 2017 09:43:07 +0800 Subject: [PATCH 79/84] Delete newgif.py --- ext/newgif.py | 266 -------------------------------------------------- 1 file changed, 266 deletions(-) delete mode 100644 ext/newgif.py diff --git a/ext/newgif.py b/ext/newgif.py deleted file mode 100644 index 8c01dbc2..00000000 --- a/ext/newgif.py +++ /dev/null @@ -1,266 +0,0 @@ -import discord -from discord.ext import commands -import safygiphy - -nsfw = [ - '4chan', - 'a$$', - 'a2m', - 'air-lock', - 'anal sex', - 'anal', - 'anilingus', - 'ass to mouth', - 'ass', - 'atm', - 'banjee', - 'bara', - 'bareback', - 'bear', - 'beard', - 'bi-curious', - 'bitch', - 'blowjob', - 'blue balls', - 'boobs', - 'bottom', - 'booru', - 'breasts', - 'breeder', - 'bugchasing', - 'bukkake', - 'butch', - 'butt', - 'camel toe', - 'camel-toe', - 'centerfold', - 'chicken', - 'chickenhawk', - 'chickenhead', - 'childbirth', - 'chub', - 'circle-jerk', - 'clit', - 'clitoris', - 'cock', - 'cock-tease', - 'cornhole', - 'cougar', - 'creampie', - 'cum', - 'cum-shot', - 'cunnilingus', - 'cunilingus', - 'cunt', - 'daddy', - 'daisy-chain', - 'danbooru', - 'deep-throat', - 'deep-throating', - 'dicc', - 'dick', - 'dildo', - 'dilf', - 'dirty sanchez', - 'dirty-sanchez', - 'dogging', - 'donkey-punch', - 'douche', - 'down-low', - 'downblouse', - 'dyke', - 'facial', - 'fack', - 'fag-hag', - 'felching', - 'fluffer', - 'fock', - 'fruit', - 'fuck', - 'fucks', - 'fullnelson', - 'g-spot', - 'gang-bang', - 'gay-for-pay', - 'genitals', - 'girlfriend experience', - 'glory hole', - 'glory-hole', - 'gokkun', - 'gonzo', - 'gspot', - 'hogging', - 'hot-karl', - 'insert', - 'intercourse', - 'jack off', - 'lesbian', - 'lipstick', - 'mama-san', - 'mat', - 'menage', - 'mile high', - 'milf', - 'modafoka', - 'money shot', - 'motherfucker', - 'naked', - 'nibble', - 'nipples', - 'nookie', - 'nsfw', - 'nude', - 'oral', - 'oral-sex', - 'orgasm', - 'ovaries', - 'paysite', - 'pearl necklace', - 'pegging', - 'penis', - 'pirate', - 'point-of-view', - 'porn', - 'pornhub', - 'profanity', - 'pussy', - 'queen', - 'quickie', - 'rosebud', - 'rusty-trombone', - 'saddlebacking', - 'sag', - 'saggie', - 'saggy', - 'serosorting', - 'sex', - 'shemale', - 'slut', - 'snowballing', - 'sodomite', - 'soggy', - 'stds', - 'swish', - 'switch', - 'teabagging', - 'testicles', - 'tit-fuck', - 'tits', - 'titsfuck', - 'top', - 'trade', - 'troll', - 'turkey slap', - 'twat', - 'twink', - 'upskirt', - 'vagina', - 'vaginal', - 'wanker', - 'whale tail', - 'whore', - 'xbooru', - 'yandere', - 'agfay', - 'airlock', - 'arse', - 'avm', - 'ballbuster', - 'balls', - 'batty', - 'bj', - 'blow', - 'blowjob', - 'blow job', - 'blow-job', - 'bowy', - 'brownie', - 'bugger', - 'bukkake', - 'butch', - 'cock', - 'cream pie', - 'cream-pie', - 'creampie', - 'cucc', - 'cuck', - 'deepthroat', - 'double penetration', - 'double-penetration', - 'doublepenetration', - 'dp', - 'dt', - 'dyke', - 'echi', - 'facial', - 'fag', - 'fagg', - 'faggot', - 'fairy', - 'fapping', - 'fat', - 'foursome', - 'fug', - 'full nelson', - 'furry', - 'gang bang', - 'gang-bang', - 'gangbang', - 'gokkun', - 'golden shower', - 'goldenshower', - 'h', - 'hand job', - 'handjob', - 'hj', - 'hentai', - 'hitter', - 'humiliation', - 'jackoff', - 'jerk', - 'jerking', - 'lewd', - 'masturbation', - 'muff', - 'muffdiver', - 'muncher', - 'pansy', - 'pegging', - 'pillow', - 'pimp', - 'pooftah', - 'poofter', - 'porn', - 'pornographic', - 'pornography', - 'poufter', - 'pron', - 'pufter', - 'queer', - 'rape', - 'sex', - 'sexual', - 'shag', - 'shagger', - 'skank', - 'skank', - 'slut', - 'sperm', - 'strap on', - 'strap-on', - 'swallow', - 'swallower', - 'swallows', - 'thespian', - 'thot', - 'threesome', - 'tosser', - 'trap', - 'uncensored', - 'weeny', - 'whinnie', - 'whore', - 'yaoi', - 'yuri', - 'xxx' -] From b12fd2973dcb21bb70b97fc365f8abc3956b0128 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Thu, 16 Nov 2017 10:44:40 +0800 Subject: [PATCH 80/84] Fix up your filter for gifs --- cogs/community/nsfw.py | 1 + cogs/misc.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cogs/community/nsfw.py b/cogs/community/nsfw.py index 568c8439..2d18733c 100644 --- a/cogs/community/nsfw.py +++ b/cogs/community/nsfw.py @@ -31,6 +31,7 @@ import json import io import safygiphy +from ext import embed2box class Nsfw: """ Nsfw commands """ diff --git a/cogs/misc.py b/cogs/misc.py index 96f51266..d9ce866e 100644 --- a/cogs/misc.py +++ b/cogs/misc.py @@ -57,7 +57,6 @@ from PIL import Image import safygiphy from ext import embedtobox -from ext import nsfwgif class NumericStringParserForPython3(object): @@ -163,7 +162,9 @@ async def gif(self, ctx, *, tag): load community.nsfw ''' g = safygiphy.Giphy() tag = tag.lower() - if tag in nsfwgif.nsfw: + with open('data/nsfw.json')as f: + nsfwgif = json.load(f) + if tag in nsfwgif: return await ctx.send('`Please use the nsfw commands to see content like this.`', delete_after=5) gif = g.random(tag=tag) color = await ctx.get_dominant_color(ctx.author.avatar_url) From a1395074b1ece5f94956112b5f2fd1b966f15fa8 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Thu, 16 Nov 2017 10:48:40 +0800 Subject: [PATCH 81/84] nsfw.json --- .gitignore | 1 - data/nsfw.json | 249 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 data/nsfw.json diff --git a/.gitignore b/.gitignore index 8e93b1cd..754454e7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ __pycache__/ *.py[cod] *$py.class *.DS_Store -*.json data/community_cogs.txt diff --git a/data/nsfw.json b/data/nsfw.json new file mode 100644 index 00000000..80cecd17 --- /dev/null +++ b/data/nsfw.json @@ -0,0 +1,249 @@ +[ + "4chan", + "a$$", + "a2m", + "air-lock", + "anal sex", + "anal", + "anilingus", + "ass to mouth", + "ass", + "atm", + "banjee", + "bara", + "bareback", + "bear", + "beard", + "bi-curious", + "bitch", + "blowjob", + "blue balls", + "boobs", + "bottom", + "breasts", + "breeder", + "bugchasing", + "bukkake", + "butch", + "butt", + "camel toe", + "camel-toe", + "centerfold", + "chicken", + "chickenhawk", + "chickenhead", + "childbirth", + "chub", + "circle-jerk", + "clit", + "clitoris", + "cock", + "cock-tease", + "cornhole", + "cougar", + "creampie", + "cum", + "cum-shot", + "cunt", + "daddy", + "daisy-chain", + "danbooru", + "deep-throat", + "deep-throating", + "dicc", + "dick", + "dildo", + "dilf", + "dirty sanchez", + "dirty-sanchez", + "dogging", + "donkey-punch", + "douche", + "down-low", + "downblouse", + "dyke", + "facial", + "fack", + "fag-hag", + "felching", + "fluffer", + "fock", + "fruit", + "fuck", + "fucks", + "fullnelson", + "g-spot", + "gang-bang", + "gay-for-pay", + "genitals", + "girlfriend experience", + "glory hole", + "glory-hole", + "gokkun", + "gonzo", + "gspot", + "hogging", + "hot-karl", + "insert", + "intercourse", + "jack off", + "lesbian", + "lipstick", + "mama-san", + "mat", + "menage", + "mile high", + "milf", + "modafoka", + "money shot", + "motherfucker", + "naked", + "nibble", + "nipples", + "nookie", + "nsfw", + "nude", + "oral", + "oral-sex", + "orgasm", + "ovaries", + "paysite", + "pearl necklace", + "pegging", + "penis", + "pirate", + "point-of-view", + "porn", + "pornhub", + "profanity", + "pussy", + "queen", + "quickie", + "rosebud", + "rusty-trombone", + "saddlebacking", + "sag", + "saggie", + "saggy", + "serosorting", + "sex", + "shemale", + "slut", + "snowballing", + "sodomite", + "soggy", + "stds", + "swish", + "switch", + "teabagging", + "testicles", + "tit-fuck", + "tits", + "titsfuck", + "top", + "trade", + "troll", + "turkey slap", + "twat", + "twink", + "upskirt", + "vagina", + "vaginalwanker", + "whale tail", + "whore", + "xbooru", + "yandere", + "agfay", + "airlock", + "arse", + "avm", + "ballbuster,balls", + "batty", + "bowy", + "brownie", + "bugger", + "bukkake", + "butch", + "cock", + "cream pie", + "cream-pie", + "creampie", + "cucc", + "cuck", + "deepthroat", + "double penetration", + "double-penetration", + "doublepenetration", + "dp", + "dt", + "dyke", + "echi", + "facial", + "fag", + "fagg", + "faggot", + "fairy", + "fapping", + "fat", + "foursome", + "fug", + "full nelson", + "furry", + "gang bang", + "gang-bang", + "gangbang", + "gokkun", + "golden shower", + "goldenshower", + "h", + "hentai", + "hitter", + "humiliation", + "jackoff", + "jerk", + "jerking", + "lewd", + "masturbation", + "muff", + "muffdiver", + "muncher", + "pansy", + "pegging", + "pillow", + "pimp", + "pooftah", + "poofter", + "porn", + "pornographic", + "pornography", + "poufter", + "pron", + "pufter", + "queer", + "rape", + "sex", + "sexual", + "shag", + "shagger", + "skank", + "skank", + "slut", + "sperm", + "strap on", + "strap-on", + "swallow", + "swallower", + "swallows", + "thespian", + "thot", + "threesome", + "tosser", + "trap", + "uncensored", + "weeny", + "whinnie", + "whore", + "yaoi", + "yuri", + "xxx" +] \ No newline at end of file From b77c6153e1daf6ce4a5a767bf32e02e358afb4ba Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Thu, 16 Nov 2017 10:49:23 +0800 Subject: [PATCH 82/84] Fix embed desc for presence --- cogs/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cogs/utils.py b/cogs/utils.py index 11e60fbe..23618e92 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -162,11 +162,11 @@ async def _presence(self, ctx, status, *, message=None): Image.new('RGB', (500, 500), color).save(file, format='PNG') if message: emb.description = f""" - Your presence has been changed. 'Game': {message}\n - NOTICE: due to recent Discord API changes, this command is on revision. - Available feature is to change Playing message for the time being. - Please use your client's own feature to change between online, idle, dnd, or invisible. - Thanks for your understanding. +Your presence has been changed. 'Game': {message}\n +NOTICE: due to recent Discord API changes, this command is on revision. +Available feature is to change Playing message for the time being. +Please use your client's own feature to change between online, idle, dnd, or invisible. +Thanks for your understanding. """ else: emb.description = f"Your presence has been changed" From 78169c0da9ef244a064ac7b193d7a166ad1dffd4 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee Date: Thu, 16 Nov 2017 10:53:41 +0800 Subject: [PATCH 83/84] close #194 --- cogs/gitcog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/gitcog.py b/cogs/gitcog.py index 282c78af..2738f9c7 100644 --- a/cogs/gitcog.py +++ b/cogs/gitcog.py @@ -68,7 +68,7 @@ async def issue(self, ctx, repo, issueid): @commands.command() async def makeissue(self, ctx, repo, title, *, body): - '''Create an issue! `{}makeissue | <body>`'''.format(ctx.prefix) + '''Create an issue! `{p}makeissue <title> | <body>`''' async with ctx.session.post(f'https://api.github.com/repos/{repo}/issues', json={"title": title, "body": body}, headers={'Authorization': f'Bearer {self.githubtoken}'}) as resp: if resp.status == 200 or resp.status == 201: issueinfo = await resp.json() From 7484753b499537f61b783aa28e2cbbc20e0c7842 Mon Sep 17 00:00:00 2001 From: Jia Rong Yee <yeejiarong2004@gmail.com> Date: Thu, 16 Nov 2017 10:53:49 +0800 Subject: [PATCH 84/84] close #187 --- cogs/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/utils.py b/cogs/utils.py index 23618e92..e1cba3a6 100644 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -1056,6 +1056,8 @@ async def make(self, ctx, name, *, content): '''Create a custom command! Include `{pycc}` in the content to specify a pycc!''' git = self.bot.get_cog('Git') if not await git.starred('verixx/selfbot.py'): return await ctx.send('**This command is disabled as the user have not starred <https://github.com/verixx/selfbot.py>**') + if discord.utils.get(bot.commands, name=name) != None: + return await ctx.send('This is already an existing command.') with open('data/cc.json') as f: commands = json.load(f) try: