Skip to content
Permalink
Browse files
help function is available
  • Loading branch information
lycette2 committed Nov 23, 2020
1 parent 5f3b3a8 commit 1aad393f8607889b1d716373f5da032a0d20be7a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
BIN +0 Bytes (100%) .vs/Chatbot/v16/.suo
Binary file not shown.
BIN +0 Bytes (100%) .vs/slnx.sqlite
Binary file not shown.
@@ -25,6 +25,9 @@ api = WebAPI(key=steamApiKey)

#==================DEFINITIONS GO HERE==================
#==================Emily=Function=Start=================
def helpFunction():
reply = "So you want to know what I can do... \n\nI can say hello, try saying hi sometime \n\nI can send a cat pic if you ask for cats, or if I sense you're upset. \n\nI can start a poll so you guys can vote on the community spirit. \nThis function does require you to start your message with \"salt\" or \"Salt\" \nI'm sure you can figure out the rest.\n\nI can tell you the hours spent on a game, but I do need to have your Steam ID first. \nThe game needs to be in brackets for me to search it. \nIt's also case sensitive because steam allows two games with the same name but different cases for some reason \n\nOnce I have that pesky Steam ID I can also fetch your Steam acievement percentages \non any game (on Steam), but the game still needs to be in brackets. \n\nI can also check if you have been banned. Just ask me. \n\nOnce you've given me your Steam ID there is no limit! \nMaybe there is a limit and that limit is checking things on Steam... \nIf you're nice I won't target you first in the upcoming Bot Wars:tm:"
return reply

def botGreeting():
creepyHellos =["Why hello there, I am awakening from my slumber",
@@ -90,11 +93,11 @@ def isUserBanned(discordID):#Emily
api = requests.get("http://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key=" + steamApiKey + "&steamids="+ str(steamID))
#print (linkCheck)
api = api.text
api = ['"CommunityBanned":true', '"VACBanned":true', '"NumberOfVACBans":1', '"DaysSinceLastBan":1', '"NumberOfGameBans":5', '"EconomyBan":"none"}]}']
api = ['"CommunityBanned":true', '"VACBanned":true', '"NumberOfVACBans":1', '"DaysSinceLastBan":5', '"NumberOfGameBans":5', '"EconomyBan":"none"}]}']
#this section turns the string into a list
api = list(api.split(","))
api = api[1:7]
print (api)
#api = list(api.split(","))
#api = api[1:7]
#print (api)
#if no bans starts off the "good gamer" branch
if api == ['"CommunityBanned":false', '"VACBanned":false', '"NumberOfVACBans":0', '"DaysSinceLastBan":0', '"NumberOfGameBans":0', '"EconomyBan":"none"}]}']:
reply = ["Looks like you've been good! No bans all round",
@@ -170,7 +173,7 @@ def registerSteamID(message, discordID):
if count == 17:
formattedSteamID = formattedSteamID[adjacencyStartIndex:charNum+1]
break
if len(formattedSteamID) == 17 and formattedSteamID.isdigit(): #and formattedSteamID.is_valid(): in the documentation but currently doesn't work
if len(formattedSteamID) == 17 and formattedSteamID.isdigit(): # and formattedSteamID.steam.steamid.is_valid(): #in the documentation but currently doesn't work
if (formattedSteamID not in tempIDArraySteam) and (discordID not in tempIDArrayDiscord) :
tempIDArrayDiscord.append(discordID)
tempIDArraySteam.append(formattedSteamID)
@@ -291,21 +294,23 @@ async def on_message(message): #checks for a message

banWords = ["banned", "ban", "bans"]
if "steam" in message.content.lower() and [entry for entry in banWords if(entry in message.content.lower())]:
try:
#try:
await message.channel.send(isUserBanned(message.author.id))
except:
await message.channel.send(noSteamIDErrorReplies())
#except:
#await message.channel.send(noSteamIDErrorReplies())

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

sadWords = ["sad", "upset", "unhappy", "depressed", "miserable", "despair", "dejected", "glum", "gloomy", "broken heart", "forlorn", "heartbroken", "melancholy", "woebegone"]
sadWords = ["sad", "upset", "unhappy", "depressed", "miserable", "despair", "dejected", "glum", "gloomy", "broken heart", "forlorn", "heartbroken", "melancholy", "woebegone", "cry",]
firstPersonWords = [" i ", "me", "we", "i am", "i'm", "my"]
if [entry for entry in sadWords if(entry in message.content.lower())] and ([entry for entry in firstPersonWords if(entry in message.content.lower())] or message.content.lower().startswith("i")):
await message.channel.send(cheerUpWithCats())
await message.channel.send(iNeedACat())

if "help" in message.content.lower() and "bot" in message.content.lower():
await message.channel.send(helpFunction())
# ================================================

# ================ Masud did this ================

0 comments on commit 1aad393

Please sign in to comment.