mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-10-21 13:14:23 -04:00
Compare commits
53 Commits
Author | SHA1 | Date | |
---|---|---|---|
4a59ad7103 | |||
349ad4d926 | |||
1b7dcedca2 | |||
cedf3c6d72 | |||
4e334c1459 | |||
dad83d5001 | |||
8a1bc2137b | |||
c6fb55a097 | |||
a4e30196be | |||
|
d1749c7760 | ||
|
5a42a3e11a | ||
c15ddaa8ed | |||
275493b0f5 | |||
3a84baa944 | |||
4a7e7ea431 | |||
b28ed796d6 | |||
9239d10a6f | |||
abb41e182e | |||
02f9f7e643 | |||
fdb14602c3 | |||
007e46b135 | |||
b75e153a1a | |||
174737a4a4 | |||
76d24311f0 | |||
95e85be5de | |||
3bb8fc6d76 | |||
2aa12d057c | |||
|
816118633d | ||
c8e2828043 | |||
167d69e564 | |||
b155c84cfc | |||
|
7ff29383a2 | ||
2b98f98b1c | |||
41d0ad4f58 | |||
793239ed36 | |||
000a629bff | |||
be11882ba4 | |||
cc72efadce | |||
f490760d11 | |||
b3b6da7775 | |||
51b5d48d4a | |||
2825436969 | |||
|
ccb79f1233 | ||
|
866756dfb2 | ||
|
9cef57c075 | ||
|
e0d2b5d291 | ||
|
80c6a2fe8c | ||
5c2692b660 | |||
3f9532cf56 | |||
91f4c849eb | |||
b0d6c6490e | |||
dac06d57e1 | |||
6732fe4db5 |
17
.github/workflows/dockerimage.yml
vendored
17
.github/workflows/dockerimage.yml
vendored
@@ -1,17 +0,0 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag osselbot:$(date +%s)
|
20
.github/workflows/dockerpub.yml
vendored
20
.github/workflows/dockerpub.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Publish Docker image
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to GitHub Packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Push to GitHub Packages
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
repository: techniclor-creamsicle/osselbot/osselbot
|
||||
tag_with_ref: true
|
20
.github/workflows/dockerpub3.yml
vendored
20
.github/workflows/dockerpub3.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Publish Docker image
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to GitHub Packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Push to GitHub Packages
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: docker.pkg.github.com
|
||||
repository: techniclor-creamsicle/osselbot/osselbot
|
||||
tag_with_ref: true
|
29
.github/workflows/nodejs.yml
vendored
Normal file
29
.github/workflows/nodejs.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
33
.github/workflows/npmpublish.yml
vendored
Normal file
33
.github/workflows/npmpublish.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
||||
|
||||
name: Node.js Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
|
||||
publish-gpr:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://npm.pkg.github.com/
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
node_modules/
|
||||
.DS_Store
|
3
.npmrc
Normal file
3
.npmrc
Normal file
@@ -0,0 +1,3 @@
|
||||
@technicolor-creamsicle:registry=https://npm.pkg.github.com/
|
||||
//npm.pkg.github.com/:_authToken=415f56140c8bd65b557e518c038b910fe11e3448
|
||||
prefix=/usr
|
17
Dockerfile
17
Dockerfile
@@ -1,17 +0,0 @@
|
||||
# Use the official image as a parent image.
|
||||
FROM node:current-slim
|
||||
|
||||
# Set the working directory.
|
||||
WORKDIR ./DOCKER
|
||||
|
||||
# Copy the file from your host to your current location.
|
||||
COPY ./package.json .
|
||||
COPY ./package-lock.json .
|
||||
# Run the command inside your image filesystem.
|
||||
RUN npm install
|
||||
|
||||
# Run the specified command within the container.
|
||||
CMD [ "npm", "start" ]
|
||||
|
||||
# Copy the rest of your app's source code from your host to your image filesystem.
|
||||
COPY ./src/ .
|
@@ -1,5 +1,3 @@
|
||||
# Osselbot
|
||||
A bot that is kinda stupid but it works surprisingly well
|
||||
|
||||
|
||||

|
||||

|
||||
|
10
build.sh
10
build.sh
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#logs in as Alex
|
||||
cat ~/.GHTOKEN | docker login https://docker.pkg.github.com -u technicolor-creamsicle --password-stdin
|
||||
#Builds the package
|
||||
docker build --tag osselbot .
|
||||
#pushes to github
|
||||
docker tag osselbot:latest docker.pkg.github.com/techniclor-creamsicle/osselbot/osselbot:$1
|
||||
docker push docker.pkg.github.com/techniclor-creamsicle/osselbot/osselbot:$1
|
||||
|
||||
echo build may have passed using version: $1
|
125
npm-shrinkwrap.json
generated
Normal file
125
npm-shrinkwrap.json
generated
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"name": "@technicolor-creamsicle/osselbot",
|
||||
"version": "2.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@discordjs/collection": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
||||
},
|
||||
"@discordjs/form-data": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"abort-controller": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||
"requires": {
|
||||
"event-target-shim": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
},
|
||||
"discord.js": {
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.2.0.tgz",
|
||||
"integrity": "sha512-Ueb/0SOsxXyqwvwFYFe0msMrGqH1OMqpp2Dpbplnlr4MzcRrFWwsBM9gKNZXPVBHWUKiQkwU8AihXBXIvTTSvg==",
|
||||
"requires": {
|
||||
"@discordjs/collection": "^0.1.5",
|
||||
"@discordjs/form-data": "^3.0.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"prism-media": "^1.2.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ws": "^7.2.1"
|
||||
}
|
||||
},
|
||||
"event-target-shim": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.44.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.27",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||
"requires": {
|
||||
"mime-db": "1.44.0"
|
||||
}
|
||||
},
|
||||
"n": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/n/-/n-6.5.1.tgz",
|
||||
"integrity": "sha512-CSDShHuBlYHfS5PR4BxwkZYNrDnc3B7GCRdAhSvnzl681Pd4Y4qOOTWQqjB8Cp6gYOIQI9qJxLK0Q1YI4xO2Kg=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"parse-ms": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
|
||||
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="
|
||||
},
|
||||
"pretty-ms": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz",
|
||||
"integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==",
|
||||
"requires": {
|
||||
"parse-ms": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"prism-media": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.2.tgz",
|
||||
"integrity": "sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw=="
|
||||
},
|
||||
"setimmediate": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
||||
},
|
||||
"ws": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
||||
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,2 @@
|
||||
const { ShardingManager } = require('discord.js');
|
||||
const manager = new ShardingManager('./bot.js', { token: 'Njc4MDkzNjY4NzcwNTEyOTE3.XkdyyA.6n4wvPmzOw-fwuysEoTPU8Cv2x0' });
|
||||
|
||||
manager.spawn();
|
||||
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
|
||||
DEPRICATED
|
||||
|
125
package-lock.json
generated
125
package-lock.json
generated
@@ -1,125 +0,0 @@
|
||||
{
|
||||
"name": "osselbot",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@discordjs/collection": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.5.tgz",
|
||||
"integrity": "sha512-CU1q0UXQUpFNzNB7gufgoisDHP7n+T3tkqTsp3MNUkVJ5+hS3BCvME8uCXAUFlz+6T2FbTCu75A+yQ7HMKqRKw=="
|
||||
},
|
||||
"@discordjs/form-data": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"abort-controller": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||
"requires": {
|
||||
"event-target-shim": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
},
|
||||
"discord.js": {
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.2.0.tgz",
|
||||
"integrity": "sha512-Ueb/0SOsxXyqwvwFYFe0msMrGqH1OMqpp2Dpbplnlr4MzcRrFWwsBM9gKNZXPVBHWUKiQkwU8AihXBXIvTTSvg==",
|
||||
"requires": {
|
||||
"@discordjs/collection": "^0.1.5",
|
||||
"@discordjs/form-data": "^3.0.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"prism-media": "^1.2.0",
|
||||
"setimmediate": "^1.0.5",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ws": "^7.2.1"
|
||||
}
|
||||
},
|
||||
"event-target-shim": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.44.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.27",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||
"requires": {
|
||||
"mime-db": "1.44.0"
|
||||
}
|
||||
},
|
||||
"n": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/n/-/n-6.5.1.tgz",
|
||||
"integrity": "sha512-CSDShHuBlYHfS5PR4BxwkZYNrDnc3B7GCRdAhSvnzl681Pd4Y4qOOTWQqjB8Cp6gYOIQI9qJxLK0Q1YI4xO2Kg=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"parse-ms": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
|
||||
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="
|
||||
},
|
||||
"pretty-ms": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz",
|
||||
"integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==",
|
||||
"requires": {
|
||||
"parse-ms": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"prism-media": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.2.tgz",
|
||||
"integrity": "sha512-I+nkWY212lJ500jLe4tN9tWO7nRiBAVdMv76P9kffZjYhw20raMlW1HSSvS+MLXC9MmbNZCazMrAr+5jEEgTuw=="
|
||||
},
|
||||
"setimmediate": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
||||
},
|
||||
"ws": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
|
||||
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
|
||||
}
|
||||
}
|
||||
}
|
19
package.json
19
package.json
@@ -1,17 +1,26 @@
|
||||
{
|
||||
"name": "osselbot",
|
||||
"version": "1.1.0",
|
||||
"description": "Discordbot on Discord.js",
|
||||
"name": "@technicolor-creamsicle/osselbot",
|
||||
"version": "2.1.0",
|
||||
"description": "A discord bot on Discord.js",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"discord.js": "^12.1.1",
|
||||
"n": "^6.4.0",
|
||||
"pretty-ms": "^6.0.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://npm.pkg.github.com/"
|
||||
},
|
||||
"bin": {
|
||||
"osselbot": "./src/index.js"
|
||||
},
|
||||
"files": [
|
||||
"/src/"
|
||||
],
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node ./index.js"
|
||||
"test": "node ./src/index --TEST",
|
||||
"start": "node ./src/index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
1
quotes.json
Normal file
1
quotes.json
Normal file
@@ -0,0 +1 @@
|
||||
{"quotes":["you can add quotes by running ?quote add <person> Quote goes here","techt parm arm zarm","<@!258325046869622785> I HATE JS."]}
|
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
|
||||
"prefix" : ";"
|
||||
"prefix" : "?"
|
||||
}
|
||||
|
96
src/index.js
Normal file → Executable file
96
src/index.js
Normal file → Executable file
@@ -2,29 +2,50 @@
|
||||
// Load up the libraries
|
||||
const Discord = require("discord.js");
|
||||
const prettyMilliseconds = require('pretty-ms');
|
||||
const fs = require('fs');
|
||||
const homedir = require('os').homedir;
|
||||
const info = require("../package.json")
|
||||
//importing files
|
||||
const config = require("./config.json");
|
||||
// This is the client
|
||||
// This is making clients
|
||||
const client = new Discord.Client();
|
||||
|
||||
|
||||
|
||||
function activity() {
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
};
|
||||
|
||||
client.on("ready", () => {
|
||||
// This event will run if the bot starts, and logs in, successfully.
|
||||
console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`);
|
||||
// Example of changing the bot's playing game to something useful. `client.user` is what the
|
||||
// docs refer to as the "ClientUser".
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
activity();
|
||||
});
|
||||
//Updates people count
|
||||
client.on('guildMemberAdd', member => {
|
||||
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
activity();
|
||||
});
|
||||
client.on('guildMemberRemove', member => {
|
||||
console.log(` member left: ${member.name} (id: ${member.id}).`);
|
||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||
activity();
|
||||
});
|
||||
|
||||
setInterval(activity, 300000);
|
||||
|
||||
////// ACTUAL MESSAGE PROCESSING
|
||||
client.on("message", async message => {
|
||||
//stops bots from activating the Osselbot
|
||||
//Message processing
|
||||
|
||||
if(message.content.toLowerCase().includes('nigg',"niglet","negro","fag","f4g","n1gg","gg3r")) {
|
||||
message.delete();
|
||||
return message.reply(`Listen here cum-sock we dont appeciate that here ${message.member}. If you gonna be like that you may just well end up in the JAR and we all know how that ends...`)
|
||||
}
|
||||
|
||||
|
||||
if(message.author.bot) return;
|
||||
if(message.content.indexOf(config.prefix) !== 0) return;
|
||||
// Here we separate our "command" name, and our "arguments" for the command.
|
||||
@@ -54,13 +75,14 @@ client.on("message", async message => {
|
||||
if (command === "stats") {
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle('Stats')
|
||||
.setAuthor("Osselbot", "https://cdn.discordapp.com/attachments/597814181084921866/711843993914310656/animated-beach-balls-29.gif")
|
||||
.setColor(0x195080)
|
||||
.setDescription(`\
|
||||
**Stats for 0SSELB0T** \n \
|
||||
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
||||
**Started at:** ${client.readyAt} \n \
|
||||
**People:** ${client.users.cache.size}\
|
||||
`);
|
||||
**People:** ${client.users.cache.size}`)
|
||||
.setFooter(`osselbot v${info.version} run version for full info`);
|
||||
return message.channel.send(embed);
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -113,6 +135,63 @@ client.on("message", async message => {
|
||||
};
|
||||
return;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
if(command === "say") {
|
||||
// makes the bot say something and delete the message. As an example, it's open to anyone to use.
|
||||
// To get the "message" itself we join the `args` back into a string with spaces:
|
||||
const sayMessage = args.join(" ");
|
||||
if (message.member.roles.cache.some(r=>["Admin","Mods","Member of the Order","Botmeister","Ally of the Order","say"].includes(r.name)) ){}
|
||||
// Then we delete the command message (sneaky, right?). The catch just ignores the error with a cute smiley thing.
|
||||
message.delete().catch(O_o=>{});
|
||||
// And we get the bot to say the thing:
|
||||
return message.channel.send(sayMessage);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
if(command === "quote") {
|
||||
|
||||
let quotes = require(`${homedir}/quotes.json`);
|
||||
var quoteadd = "";
|
||||
var selector;
|
||||
try{
|
||||
selector = args[0].toLowerCase();
|
||||
} catch (err) {
|
||||
var number = quotes.quotes.length + 1;
|
||||
let quotesend = Math.floor(Math.random() * (number - 0) + 0);
|
||||
return message.channel.send(`${quotes.quotes[quotesend]}`);
|
||||
};
|
||||
if(selector === "add") {
|
||||
if (!(message.member.roles.cache.some(r => ["Admin","Mods","Member of the Order","Botmeister","Ally of the Order","say"].includes(r.name)))) return message.reply("Ask someone with the quote role to add that.")
|
||||
args.shift();
|
||||
//This does logic to make it from an array to a nice string.
|
||||
quoteadd = args.join(' ');
|
||||
quotes.quotes.push(quoteadd)
|
||||
fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes, null, 2), (err) => {
|
||||
if (err) return message.reply("Something went wrong");``
|
||||
client.channels.cache.get('712084662033580064').send(`${message.member} has submitted \`${quoteadd}\` to the quote repository`);
|
||||
return message.reply("Quote added to repository");
|
||||
});
|
||||
}
|
||||
else {
|
||||
return message.reply("you can add quotes by running `?quote add <person> Quote goes here`");
|
||||
};
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
if (command === "version") {
|
||||
return message.channel.send(`\`\`\`\
|
||||
________________________________________\n \
|
||||
< @technicolor-creamsicle/osselbot@v${info.version}>\n \
|
||||
----------------------------------------\n \
|
||||
\\ ^__^\n \
|
||||
\\ (oo)\\_______\n \
|
||||
(__)\\ )\\/\\\n \
|
||||
||----w |\n \
|
||||
|| ||\n \
|
||||
\`\`\``)
|
||||
};
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////DEFCON//////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -152,5 +231,10 @@ client.on("message", async message => {
|
||||
};
|
||||
});
|
||||
|
||||
if(process.argv.slice(2).includes("--TEST")) {
|
||||
console.log("Test Pass!");
|
||||
process.exit(0);
|
||||
};
|
||||
|
||||
//Logging in the bot
|
||||
client.login(config.token)
|
||||
|
Reference in New Issue
Block a user