Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions discord_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@
"content-type": "application/json",
"user-agent": text[0],
"authorization": text[1],
"host": "discordapp.com",
"host": "discord.com",
"referrer": text[2]
}

print("Messages will be sent to " + header_data["referrer"] + ".")

def get_connection():
return HTTPSConnection("discordapp.com", 443)
return HTTPSConnection("discord.com", 443)


def send_message(conn, channel_id, message_data):
try:
conn.request("POST", f"/api/v6/channels/{channel_id}/messages", message_data, header_data)
conn.request("POST", f"/api/v9/channels/{channel_id}/messages", message_data, header_data)
resp = conn.getresponse()

if 199 < resp.status < 300:
Expand All @@ -107,7 +107,7 @@ def main(msg):


if __name__ == '__main__':
print("Message to send- when finished, type an EOF character:")
print("Message to send- when finished, type an EOF character (use ctrl+z):")
message = sys.stdin.read()
messages = int(input("Amount of messages: "))
main_wait = int(input("Seconds between messages: "))
Expand Down