Skip to content
Permalink
Browse files
BRING THE CATS
  • Loading branch information
lycette2 committed Nov 21, 2020
1 parent 9759372 commit d044937ec631eea0127b34219cd7a880b3375cde
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 .env
@@ -1,3 +1,4 @@
DISCORD_TOKEN=NzcxNzQ2NDg5MjE5MTUzOTMw.X5wm7Q.siDgoUQOu5YtSJ8zcSpbtmxr3IM
DISCORD_GUILD=Team (O3)
STEAM_API_KEY=84D642824B05D1EF8CD1B186B728BB46
STEAM_API_KEY=84D642824B05D1EF8CD1B186B728BB46
CAT_API_KEY=afab5571-5377-4214-a573-0e24034e9bad
BIN +6.5 KB (120%) .vs/Chatbot/v16/.suo
Binary file not shown.
BIN +0 Bytes (100%) .vs/slnx.sqlite
Binary file not shown.
@@ -18,6 +18,7 @@ load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
steamApiKey = os.getenv('STEAM_API_KEY')
catApiKey = os.getenv('CAT_API_KEY')

client = discord.Client()
api = WebAPI(key=steamApiKey)
@@ -104,6 +105,20 @@ def isUserBanned(steamID):#Emily
"Getting quite the ban collection here because you're: \n" + ", ".join(banList)]

return random.choice(reply)

def iNeedACat(): # Emily
api = requests.get("https://api.thecatapi.com/v1/images/search", params = {'q': 'requests+language:python'}, headers = {"authorisation":catApiKey})
api = api.text
api = list(api.split(","))
api = api[-3]
api = api[7:-1]
return api

def catMessage():
reply = ["Here's a cat for you in these trying times",
"Emergency cat pics incoming!",
"*QUICK GET THE CATS*"]
return random.choice(reply)
#================Emily=Function=End============================================

#================BenHB=Function=Start==========================================
@@ -186,6 +201,11 @@ async def on_message(message): #checks for a message
"Something went wrong *looks pointedly at Ben*",
"Why it looks like the SteamID function broke down, I wonder why, *Ben*"]
await message.channel.send(random.choice(randomSteamIDErrorReplies))

if "cat" in message.content.lower():
await message.channel.send(catMessage())
await message.channel.send(iNeedACat())


# ================================================

0 comments on commit d044937

Please sign in to comment.