A robust and versatile solution for automated social interactions through Python.
- Open cmd.
- cd into your project directory.
- Run the following commands below to make a subtree.
cd C:/PathToMyProject
git remote add -f Discord-AutoMessage https://github.com/NathanRLiu/Discord-AutoMessage
git merge -s ours --no-commit --allow-unrelated-histories Discord-AutoMessage/main
git read-tree --prefix=discAutoMsg/ -u Discord-AutoMessage/main
git commit -m "Merge Discord-AutoMessage as a subdirectory"
- Run
$ git pull -s subtree Discord-AutoMessage main
to pull new changes - *Make sure you move creds.py from Discord-AutoMessage to your main project directory(PathToMyProject)
You can import from a python file within PathToMyProject by using import discAutoMsg.discord_automessage as discAutoMsg
.
- Download the ZIP from the GitHub Repository.
- Extract the ZIP.
- Move the files to the same directory as your project.
- Either one of the following:
- Get your Discord authentication token and paste it into the config.py file OR
- Put your email/password into the config.py file
- You can now import the functions of the module by simply calling
import discord-automessage
- After importing the module, you can now reference its functions by calling
discord-automessage.functionName
, for example:discord-automessage.sendMessage(channelID,"Hello World!")
sendMessage(daChannelID, daMessage)
- daChannelID is a
string
which is passed as the ID of the channel. - daMessage is a
string
which is passed as the content of the message.
sendReply(daChannelID, daMessage, msgToReply)
- daChannelID is a
string
orint
which is passed as the ID of the channel. - daMessage is a
string
which is passed as the content of the message. - msgToReply is a
string
orint
which is the messageID of the message to reply to
getMessages(daChannelID, daRange)
- daChannelID is a
string
which is passed as the ID of the channel. - daRange is an
int
which denotes how many messages you want returned.
- For usage examples, check out my other project: https://github.com/NathanRLiu/SimpTron-3000