Skip to content

Commit

Permalink
made some changes
Browse files Browse the repository at this point in the history
add return statements to end function execution

added start script
  • Loading branch information
Chandler Lofland authored and chand1012 committed Jun 16, 2020
1 parent da82519 commit ad21aa6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode/*

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

3 changes: 3 additions & 0 deletions bot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

python3 bot.py
9 changes: 6 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
from json import loads
from random import choice

Expand Down Expand Up @@ -35,10 +36,10 @@ def get_tweet(person): # this uses the cursor so now I can get images
valid_tweets = []
for tweet in some_tweets.items():
if (not 'http' in tweet.text) and (not 'RT' in tweet.text):
if 'Wendys' in person or not tweet.text.startswith('@'):
if not tweet.text.startswith('@'):
valid_tweets += [[tweet.text, tweet.created_at, None]]

print(person)
#print(person)
return choice(valid_tweets)

client = discord.Client()
Expand All @@ -48,7 +49,7 @@ async def on_message(message):
recv = message.content
channel = message.channel
if message.author == client.user:
pass
return
if recv.startswith("!tweet"):
if recv[7:] is '':
person = choice(people)
Expand All @@ -60,6 +61,7 @@ async def on_message(message):
print("From: {}".format(tweet[1]))
print("------")
await client.send_message(channel, content=msg, tts=False)
return
else:
msg = None
person = recv[7:]
Expand All @@ -75,6 +77,7 @@ async def on_message(message):
print(e)
msg = "Something went wrong, either that username doesn't exist or I couldn't find a tweet that was acceptable."
await client.send_message(channel, content=msg, tts=False)
return

@client.event
async def on_ready():
Expand Down
11 changes: 11 additions & 0 deletions list.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
officialjaden
kanyewest
realDonaldTrump
elonmusk
GordonRamsay
shitgirlssay
sosadtoday
DRUNKHULK
TheTweetOfGod
SteveMartinToGo
alyankovic
ConanOBrien
StephenAtHome
YourAwayMessage

0 comments on commit ad21aa6

Please sign in to comment.