Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit 719c5bb

Browse files
committed
Added check command
1 parent de3ed30 commit 719c5bb

File tree

6 files changed

+53
-3
lines changed

6 files changed

+53
-3
lines changed

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/smrbot.iml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,28 @@ async def submit(ctx, url: str, *, args=None):
9292
await ctx.send("Please only submit the Domain without http:// or https://.")
9393
else:
9494
check = checklist(url)
95-
if check == False:
95+
if check is False:
9696
num = createissue("New site to add: "+url, args+" *Automated Issue*", ["addition"])
9797
link = "https://github.com/StopModReposts/Illegal-Mod-Sites/issues/" + str(num)
9898
await ctx.send("Your report for **{0}** has been received. I've created a GitHub issue (#{1} - <{2}>) where you can track the progress of your request. ".format(url, num, link))
99-
elif check == True:
99+
elif check is True:
100100
await ctx.send("**{0}** is already on our lists.".format(url))
101101
else:
102102
await ctx.send("Error with your request - {0}".format(check))
103-
103+
104+
105+
@bot.command(description="Check if a website is already on our lists", help="Check if a website is already on our lists")
106+
async def check(ctx, url: str):
107+
if "http" in url:
108+
await ctx.send("Please only submit the Domain without http:// or https://.")
109+
else:
110+
check = checklist(url)
111+
if check is False:
112+
await ctx.send(":x: **{0}** is not on our list.".format(url))
113+
elif check is True:
114+
await ctx.send(":white_check_mark: **{0}** is on our list.".format(url))
115+
else:
116+
await ctx.send("Error with your request - {0}".format(check))
104117

105118
# Run bot
106119
bot.run(DISCORD_TOKEN)

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
requests~=2.25.1
2+
python-dotenv~=0.15.0
3+
discord.py~=1.5.1

0 commit comments

Comments
 (0)