-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRiotBeggarBotScript.py
More file actions
38 lines (28 loc) · 1 KB
/
RiotBeggarBotScript.py
File metadata and controls
38 lines (28 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
import sys
import random
from twython import Twython
playValorantID = "1230550898616586242"
#Opens file and reads in Twitter Consumer and Access Information
with open("KeyTokenSecrets.txt") as file:
confidential = file.readlines()
confidential = [line.rstrip() for line in confidential]
file.close()
#Stores confidential information in easily-readable variables for later use
CONSUMER_KEY = confidential[0]
CONSUMER_SECRET = confidential[1]
ACCESS_TOKEN = confidential[2]
ACCESS_SECRET = confidential[3]
#Creates api object with the information stored
api = Twython(CONSUMER_KEY , CONSUMER_SECRET , ACCESS_TOKEN , ACCESS_SECRET)
with open("DMsList.txt", "r+") as file:
allDMs = file.readlines()
twitterDM = allDMs[0]
file.seek(0)
file.writelines(allDMs[1:])
file.write(twitterDM)
file.close()
api.send_direct_message(event = {"type": "message_create",
"message_create":{"target": {"recipient_id": playValorantID},
"message_data":
{"text": twitterDM}}})