Skip to content

Commit 2e68dde

Browse files
committed
Allow for easier self hosting
1 parent 6cfa3ac commit 2e68dde

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

setup

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# define some stuff
2+
3+
saveinfo()
4+
{
5+
echo "BOT_TOKEN=\"$2\"" > ./.env
6+
echo "OWNER_ID=\"$1\"" >> ./.env
7+
}
8+
9+
read_secret()
10+
{
11+
stty -echo
12+
trap 'stty echo' EXIT
13+
read "$@"
14+
stty echo
15+
trap - EXIT
16+
echo
17+
}
18+
19+
# get user inputs
20+
printf "Your Discord User Id: "
21+
read userid
22+
printf "Bot Token: "
23+
read_secret token
24+
25+
#confirm before ending
26+
while true; do
27+
printf "Is this information correct (y/n)? "
28+
read yn
29+
case $yn in
30+
[Yy]* ) saveinfo "$userid" "$token"; break;;
31+
[Nn]* ) break;;
32+
* ) echo "Please answer yes or no."; echo;;
33+
esac
34+
done
35+
# github stuff
36+
git checkout main
37+
. ./sync

sync

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
git pull origin main
2+
3+
success() {
4+
echo "$(tput setaf 2)$(tput bold)Complete$(tput sgr0)"
5+
}
6+
7+
if command -v pip &> /dev/null
8+
then
9+
pip install --upgrade -r requirements.txt --user
10+
success
11+
elif command -v pip3 &> /dev/null
12+
then
13+
pip3 install --upgrade -r requirements.txt --user
14+
success
15+
elif command -v python3 &> /dev/null
16+
then
17+
python3 -m pip install --upgrade -r requirements.txt --user
18+
success
19+
elif command -v python &> /dev/null
20+
then
21+
python -m pip install --upgrade -r requirements.txt --user
22+
success
23+
elif command -v py &> /dev/null
24+
then
25+
py -3 -m pip install --upgrade -r requirements.txt --user
26+
success
27+
elif command -v py3 &> /dev/null
28+
then
29+
py3 -m pip install --upgrade -r requirements.txt --user
30+
success
31+
else
32+
echo "$(tput sgr0)$(tput setaf 1)$(tput bold)Error, Could Not Install Requirements: $(tput sgr0)Command $(tput bold)pip$(tput sgr0) does not exist. Please run $(tput smul)pip install -r requirements.txt$(tput rmul), replacing \"pip\" with your favorite flavor of pip. Also, if you are able, please make an issue on the github repo about this error."
33+
fi

0 commit comments

Comments
 (0)