Compare commits

..

120 commits

Author SHA1 Message Date
98f491860d
remove gitlab ci
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
2024-10-10 21:19:16 +02:00
a39ea9e50b
woodpecker 2024-10-10 21:15:04 +02:00
5c0feca7b2 Merge pull request 'Update dependency py-cord to v2.6.1' (#27) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #27
2024-09-28 22:01:59 +02:00
836d6b1d3d
Update dependency py-cord to v2.6.1
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-09-15 20:22:12 +00:00
4c261a30d4
fix issue with survey script
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-12 14:37:49 +02:00
a344db3ad1
add survey bot
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-12 14:20:28 +02:00
559d8c2169
make hiebe and liebe visible in help 2024-07-12 13:07:08 +02:00
91a75741bf
remove old help and old yesno 2024-07-12 13:02:21 +02:00
f16042d81a
Update to pycord 2.6.0 and fix the embed 2024-07-12 12:59:26 +02:00
be7db764ec
roll back to 2.4.1 because of breaking changes
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-11 21:37:12 +02:00
016d2f3730 Merge pull request 'Update dependency py-cord to v2.6.0' (#26) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #26
2024-07-11 10:20:39 +02:00
a526ec91f5
Update dependency py-cord to v2.6.0
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
2024-07-09 19:10:23 +00:00
b0a3e48890
change compose directory
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-26 00:17:25 +02:00
b65bd7a363 Merge pull request 'Update dependency py-cord to v2.5.0' (#25) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #25
2024-03-16 03:27:11 +01:00
5948da8056
Update dependency py-cord to v2.5.0
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2024-03-02 09:19:30 +00:00
43a01a753b
fix container registry
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-24 20:29:10 +01:00
2a46a54637
change container registry
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-12-24 20:27:54 +01:00
74fe90b242
update pipeline because of new docker compose
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-25 21:21:35 +01:00
f9c496d158
update pipeline
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-24 04:35:05 +02:00
e753423957
remove whitespace
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-29 23:04:57 +02:00
ee561c5356
reduce prune days to 7 2023-05-29 23:04:45 +02:00
4a029f3bcd
Update python Docker tag to v3.11.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone Build is passing
continuous-integration/drone/push Build is passing
2023-04-06 01:07:49 +00:00
f6e2e961f1 Merge pull request 'Update dependency py-cord to v2.4.1' (#23) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #23
2023-03-21 00:07:07 +01:00
b5ec9bac92 Update dependency py-cord to v2.4.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-03-20 23:06:42 +00:00
a0aa24bb41
update README for gitea environment
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-13 22:19:42 +01:00
b2f1c795e6 Merge pull request 'Update dependency py-cord to v2.4.0' (#22) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #22
2023-02-11 15:15:45 +01:00
5fdf2b666c Update dependency py-cord to v2.4.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-02-11 13:16:49 +00:00
37c9f0376a Merge pull request 'Update dependency py-cord to v2.3.3' (#21) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #21
2023-02-11 13:22:44 +01:00
b4fbdc7628 Update dependency py-cord to v2.3.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-02-11 03:15:50 +00:00
749190bc61 Merge pull request 'Update python Docker tag to v3.11.2' (#20) from renovate/python-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #20
2023-02-09 10:44:20 +01:00
a34af09beb Update python Docker tag to v3.11.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-02-09 02:26:51 +00:00
81f84dddf4 Update dependency py-cord to v2.3.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2022-12-13 23:58:02 +00:00
7fa890eb28 Merge pull request 'Update dependency py-cord to v2.3.0' (#17) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #17
2022-12-13 23:42:38 +01:00
36b6077d02 Merge pull request 'Update python Docker tag to v3.11.1' (#18) from renovate/python-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #18
2022-12-13 23:42:23 +01:00
b4116bf6a0 Update python Docker tag to v3.11.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-12-08 05:05:20 +00:00
65a7e9048e Update dependency py-cord to v2.3.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-11-23 22:05:20 +00:00
498e23de92 Merge pull request 'Update dependency py-cord to v2.2.2' (#12) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #12
2022-10-14 22:29:39 +02:00
d91151f931 Update dependency py-cord to v2.2.2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2022-10-14 22:29:29 +02:00
e1d26c7bf9 Merge pull request 'Update python Docker tag to v3.10.8' (#13) from renovate/python-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #13
2022-10-14 22:29:13 +02:00
533e45acae Update python Docker tag to v3.10.8
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-10-14 01:27:51 +00:00
4abd730acb Merge pull request 'Update dependency py-cord to v2.2.1' (#11) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #11
2022-10-12 23:41:20 +02:00
7ec7376405 Update dependency py-cord to v2.2.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-10-06 02:12:42 +00:00
a29054e176 Merge pull request 'Update dependency py-cord to v2.2.0' (#10) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #10
2022-10-03 00:13:19 +02:00
c33714f2e7 Update dependency py-cord to v2.2.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-10-02 22:12:42 +00:00
fd7b680eb8
update base image
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
2022-09-08 00:36:09 +02:00
7cd2883dc0
update base image
Some checks failed
continuous-integration/drone/push Build is failing
2022-09-08 00:32:14 +02:00
2cb6af2062
add architecture to Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-08 00:30:25 +02:00
34ad3b2d09 Merge pull request 'Update dependency py-cord to v2.1.3' (#8) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #8
2022-09-08 00:24:17 +02:00
7efe4b3c13 Update dependency py-cord to v2.1.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-09-07 14:18:18 +00:00
2be135ec7b Merge pull request 'Update dependency py-cord to v2.1.2' (#7) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #7
2022-09-07 15:53:08 +02:00
281ad8f957 Update dependency py-cord to v2.1.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-09-06 21:18:18 +00:00
314caeba44 Merge pull request 'Update dependency py-cord to v2.1.1' (#6) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #6
2022-08-26 05:39:45 +02:00
84b8379926 Update dependency py-cord to v2.1.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-08-25 22:18:18 +00:00
f70f101aa5 Merge pull request 'Update dependency py-cord to v2.1.0' (#5) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #5
2022-08-25 19:01:33 +02:00
1c09edb25b Update dependency py-cord to v2.1.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-08-25 16:18:18 +00:00
0c6f070d22 Merge pull request 'Update dependency py-cord to v2.0.1' (#4) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
2022-08-18 18:50:22 +02:00
faa702ce05 Update dependency py-cord to v2.0.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-08-16 21:18:17 +00:00
6b9bb07e73 Merge pull request 'Update dependency python to v3.10.6' (#2) from renovate/python-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #2
2022-08-05 08:09:48 +02:00
06f099ca18 Update dependency python to v3.10.6
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2022-08-02 21:17:16 +00:00
0300720111
fix drone ci
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-21 17:42:08 +02:00
16eb5f4419 Merge pull request 'Update dependency py-cord to v2.0.0' (#1) from renovate/py-cord-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #1
2022-07-20 17:22:55 +02:00
cdc56b3cfd Update dependency py-cord to v2.0.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-07-09 00:17:41 +00:00
3d0d38eb30
remove test stuff
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-03 03:28:09 +02:00
0f9179d3ec
drone deploy for dev
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-03 03:24:56 +02:00
6e35a7c32b
test
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-03 03:12:46 +02:00
a1c188d1b6
add deploy ci 2022-07-03 03:11:36 +02:00
9e18b3a0be
fix repo name
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-03 02:45:20 +02:00
218505b614
test cicd
Some checks failed
continuous-integration/drone/push Build is failing
2022-07-03 02:42:28 +02:00
5cadf95f3c
add simple drone config
All checks were successful
continuous-integration/drone Build is passing
2022-07-01 03:16:22 +02:00
73cf4a1b4f Merge branch 'renovate/python-3.x' into 'master'
Update dependency python to v3.10.5

See merge request aaron-riedel/shbot!24
2022-06-21 20:07:06 +00:00
9bac3c953a
reenable cicd 2022-06-21 20:47:04 +02:00
708036b2eb
here to everyone for survey + disable deploy CD 2022-06-21 20:40:27 +02:00
13dc5b3c50
change vote ping from here to everyone 2022-06-21 20:29:58 +02:00
a9541b64e0
disable Bergtrolling 2022-06-08 23:28:34 +02:00
Renovate Bot
2dcf61557c Update dependency python to v3.10.5 2022-06-07 19:03:40 +00:00
5f48a8e845
fix modal 2022-06-02 02:06:39 +02:00
b4619c2f26
troll the Berg 2022-05-27 21:54:09 +02:00
3f78080118
fix clear_commands 2022-05-19 02:29:09 +02:00
f7cc76d280 Merge branch 'update-pycord' into 'master'
bump pycord

See merge request aaron-riedel/shbot!23
2022-05-19 00:12:25 +00:00
5591f8c02e
fix bot and bump version to rc1 2022-05-19 02:10:09 +02:00
d25b3f9a54
try to fix clear commands 2022-05-19 01:59:27 +02:00
142a49646c
try to fix clear commands 2022-05-19 01:37:40 +02:00
4ee864dc28
bump pycord 2022-05-19 01:20:08 +02:00
53c955122a
edit ci 2022-05-19 01:18:04 +02:00
9e45f698fc Revert "Merge branch 'renovate/py-cord-2.x' into 'master'"
This reverts merge request !22
2022-05-18 16:13:50 +00:00
76a083916d Merge branch 'renovate/py-cord-2.x' into 'master'
Update dependency py-cord to v2.0.0rc1

See merge request aaron-riedel/shbot!22
2022-05-17 19:34:40 +00:00
Renovate Bot
285534811d Update dependency py-cord to v2.0.0rc1 2022-05-17 19:03:55 +00:00
43c2c19e99 Merge branch 'dev' into 'master'
add hiebe command

See merge request aaron-riedel/shbot!21
2022-04-25 20:01:46 +00:00
31f17fa2cc
add hiebe command 2022-04-25 21:59:32 +02:00
e5c77ba1b5 Merge branch 'renovate/python-3.x' into 'master'
Update dependency python to v3.10.4

See merge request aaron-riedel/shbot!20
2022-04-21 09:07:43 +00:00
Renovate Bot
0cf835ef4e Update dependency python to v3.10.4 2022-04-21 09:03:30 +00:00
1c802e81fc Merge branch 'renovate/configure' into 'master'
Configure Renovate

See merge request aaron-riedel/shbot!19
2022-04-21 08:46:24 +00:00
Renovate Bot
c2b5410b47 Add renovate.json 2022-04-21 08:33:26 +00:00
9421f0ab92 add specific version tag for the docker base image 2022-04-21 06:58:20 +00:00
9ee858be01 Merge branch 'dev' into 'master'
Fix clear_commands for current py-cord version

See merge request aaron-riedel/shbot!18
2022-04-16 03:14:07 +00:00
3962d97829 Fix clear_commands for current py-cord version 2022-04-16 03:14:07 +00:00
2b2ddf6cbd Merge branch 'dev' into 'master'
show a custom activity with prefix and help command

See merge request aaron-riedel/shbot!17
2022-04-16 01:53:42 +00:00
7afb17c5a7
show a custom activity with prefix and help command 2022-04-16 03:52:28 +02:00
e045c259b5 Merge branch 'dev' into 'master'
fix start command and bump pycord version

See merge request aaron-riedel/shbot!16
2022-04-15 19:35:45 +00:00
f78cfa6853
bump pycord version 2022-04-15 21:34:38 +02:00
ac0841c8bf
fix start command# 2022-04-15 21:32:58 +02:00
5f8bcf0f93 remove bergseppel emojis 2022-04-02 19:40:52 +00:00
e5eda00efb Merge branch 'dev' into 'master'
Bergseppel approved

See merge request aaron-riedel/shbot!15
2022-03-31 17:19:12 +00:00
a11024d9d9
Bergseppel approved 2022-03-31 19:17:51 +02:00
307481b68e Merge branch 'dev' into 'master'
Dev

See merge request aaron-riedel/shbot!14
2022-03-31 17:00:31 +00:00
b7678028e7
mein Bier brennt only for Bergseppel 2022-03-31 18:59:15 +02:00
343024f523
mein Bier brennt 2022-03-31 18:58:39 +02:00
1f8f822568 Merge branch 'dev' into 'master'
switch base image to python:alpine

See merge request aaron-riedel/shbot!13
2022-03-14 16:31:53 +00:00
58306b1e72 switch base image to python:alpine 2022-03-14 16:31:53 +00:00
8db08e8e16
fix adduser command 2022-03-14 17:26:59 +01:00
542c1a9261
switch baseimage to python:alpine 2022-03-14 17:20:39 +01:00
90a1522c2a Update .gitlab-ci.yml file 2022-03-09 08:38:32 +00:00
46e75415d4 Update .gitlab-ci.yml file 2022-03-09 07:16:27 +00:00
6c7aeafecf Update .gitlab-ci.yml file 2022-03-09 07:00:44 +00:00
f76de1849d Update .gitlab-ci.yml file 2022-03-09 06:48:16 +00:00
f9bf004ba8 Update .gitlab-ci.yml file 2022-03-09 06:39:56 +00:00
dab6b75c74 Update .gitlab-ci.yml file 2022-03-09 06:22:14 +00:00
5eb107a84a Update .gitlab-ci.yml file 2022-03-09 05:20:26 +00:00
b37a41c299 Merge branch 'dev' into 'master'
add numbers to emojilist

See merge request aaron-riedel/shbot!12
2022-03-07 13:16:13 +00:00
f315c79beb
add numbers to emojilist 2022-03-07 14:13:32 +01:00
10 changed files with 191 additions and 116 deletions

View file

@ -1,54 +0,0 @@
stages:
- build
- test
- deploy
image: debian
docker-build-push:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
only:
- master
- dev
docker-build:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
except:
- master
- dev
before_script:
- apt-get update -qq
- which ssh-agent || ( apt-get install -qq openssh-client )
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
deploy_staging:
stage: deploy
script:
- ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d
shbot && exit"
only:
- master
include:
- template: Security/Container-Scanning.gitlab-ci.yml

42
.woodpecker/.build.yaml Normal file
View file

@ -0,0 +1,42 @@
steps:
- name: docker
image: woodpeckerci/plugin-docker-buildx
settings:
registry: git.ar21.de
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASS
repo: git.ar21.de/secondhemd/shbot
tags: latest
when:
- branch: master
event: [push, manual]
- name: docker-build
image: woodpeckerci/plugin-docker-buildx
settings:
registry: git.ar21.de
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASS
repo: git.ar21.de/secondhemd/shbot
tags: latest
dry_run: true
when:
- branch:
exclude: [master, dev]
event: [push, manual]
- name: dev docker
image: woodpeckerci/plugin-docker-buildx
settings:
registry: git.ar21.de
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASS
repo: git.ar21.de/secondhemd/shbot
tags: dev
when:
- branch: dev
event: [push, manual]

34
.woodpecker/.deploy.yaml Normal file
View file

@ -0,0 +1,34 @@
skip_clone: true
steps:
- name: deploy
image: appleboy/drone-ssh
settings:
host:
- s.ar21.de
username: root
key:
from_secret: DEPLOY_SSH_KEY
port: 22
command_timeout: 2m
script:
- cd ~/compose/shbot && docker compose pull shbot && docker compose up -d shbot
when:
- branch: master
event: [push, manual]
- name: deploy dev
image: appleboy/drone-ssh
settings:
host:
- s.ar21.de
username: root
key:
from_secret: DEPLOY_SSH_KEY
port: 22
command_timeout: 2m
script:
- cd /root && docker compose -f shbot-dev.yaml pull shbot-dev && docker compose -f shbot-dev.yaml up -d shbot-dev
when:
- branch: dev
event: [push, manual]
depends_on:
- build

View file

@ -1,14 +1,15 @@
FROM python:slim
WORKDIR ./
ARG PUID=1000
ENV USER docker
ENV HOMEDIR "/home/${USER}"
RUN useradd -u "${PUID}" -m "${USER}"
USER ${USER}
WORKDIR ${HOMEDIR}
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
CMD [ "python", "./bot.py" ]
FROM amd64/python:3.11.3-alpine3.16
WORKDIR ./
ARG PUID=1000
ENV GROUP dockergroup
ENV USER docker
ENV HOMEDIR "/home/${USER}"
RUN addgroup -S "${GROUP}" && adduser -S "${USER}" -G "${GROUP}"
USER ${USER}
WORKDIR ${HOMEDIR}
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
CMD [ "python", "./bot.py" ]

View file

@ -1,22 +1,22 @@
# SECOND BOT
[![pipeline status](https://git.cxservers.com/aaron-riedel/shbot/badges/master/pipeline.svg)](https://git.cxservers.com/aaron-riedel/shbot/-/commits/master)
[![Build Status](https://drone.ar21.de/api/badges/secondhemd/shbot/status.svg)](https://drone.ar21.de/secondhemd/shbot)
der Bot für den SecondHemd Discord
# Latest
## Build
```
docker build -t docker-registry.cxservers.com/aaron-riedel/shbot:latest .
docker build -t secondhemd/shbot:latest .
```
## Run
```
sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t docker-registry.cxservers.com/aaron-riedel/shbot:latest
sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t secondhemd/shbot:latest
```
## Docker compose
```
services:
bot:
image: docker-registry.cxservers.com/aaron-riedel/shbot:latest
image: secondhemd/shbot:latest
container_name: shbot
restart: unless-stopped
environment:
@ -27,17 +27,17 @@ services:
# Development
## Build
```
docker build -t docker-registry.cxservers.com/aaron-riedel/shbot:dev .
docker build -t secondhemd/shbot:dev .
```
## Run
```
sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t docker-registry.cxservers.com/aaron-riedel/shbot:dev
sudo docker run -e 'TOKEN=' -e 'PREFIX=$' -t secondhemd/shbot:dev
```
## Docker compose
```
services:
bot:
image: docker-registry.cxservers.com/aaron-riedel/shbot:dev
image: secondhemd/shbot:dev
container_name: shbot
restart: unless-stopped
environment:

81
bot.py
View file

@ -23,6 +23,7 @@ def mid(s, offset, amount):
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
intents.presences = True
token = os.environ['TOKEN']
prefix = os.environ['PREFIX']
@ -55,7 +56,7 @@ def is_gm():
return commands.check(predicate)
emojinumbers = ["0\u20E3", "1\u20E3" , "2\u20E3" , "3\u20E3" , "4\u20E3" , "5\u20E3" , "6\u20E3" , "7\u20E3" , "8\u20E3" , "9\u20E3"]
alphabet = {"a" : "🇦","b" : "🇧","c" : "🇨","d" : "🇩","e" : "🇪","f" : "🇫","g" : "🇬","h" : "🇭","i" : "🇮","j" : "🇯","k" : "🇰","l" : "🇱","m" : "🇲","n" : "🇳","o" : "🇴","p" : "🇵","q" : "🇶","r" : "🇷","s" : "🇸","t" : "🇹","u" : "🇺","v" : "🇻","w" : "🇼","x" : "🇽","y" : "🇾","z" : "🇿"}
alphabet = {"a" : "🇦","b" : "🇧","c" : "🇨","d" : "🇩","e" : "🇪","f" : "🇫","g" : "🇬","h" : "🇭","i" : "🇮","j" : "🇯","k" : "🇰","l" : "🇱","m" : "🇲","n" : "🇳","o" : "🇴","p" : "🇵","q" : "🇶","r" : "🇷","s" : "🇸","t" : "🇹","u" : "🇺","v" : "🇻","w" : "🇼","x" : "🇽","y" : "🇾","z" : "🇿","0" : "0\u20E3","1" : "1\u20E3","2" : "2\u20E3","3" : "3\u20E3","4" : "4\u20E3","5" : "5\u20E3","6" : "6\u20E3","7" : "7\u20E3","8" : "8\u20E3","9" : "9\u20E3"}
bot.help_command = commands.DefaultHelpCommand(dm_help=False, no_category="Befehle die du nutzen kannst")
@ -72,6 +73,14 @@ async def on_command_error(ctx, error):
@bot.event
async def on_ready():
print("Bot ready on Version %s..." % discord.__version__)
activity = discord.Activity(name='%shelp' % prefix, type=discord.ActivityType.listening)
#activity = discord.Game('%shelp for Help' % prefix)
await bot.change_presence(status=discord.Status.online, activity=activity)
#@bot.listen()
#async def on_presence_update(before, after):
# if not before.is_on_mobile() and after.id == 274197471515639808 and after.is_on_mobile():
# await bot.get_channel(512004326382632961).send("https://cdn.discordapp.com/attachments/512004326382632961/979468921985982514/unknown.png")
class Confirm(discord.ui.View):
def __init__(self):
@ -91,8 +100,8 @@ class Confirm(discord.ui.View):
self.stop()
@bot.slash_command(guild_ids=[261575556708040705])
@permissions.has_role(member_role)
async def roll(ctx,
@commands.has_role(member_role)
async def roll(ctx,
dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"),
):
"""Rolle einen oder mehrere Würfel"""
@ -124,8 +133,8 @@ async def roll(ctx,
await ctx.response.send_message(embed=em)
@bot.slash_command(guild_ids=[261575556708040705])
@permissions.has_role(gm_role)
async def gmroll(ctx,
@commands.has_role(gm_role)
async def gmroll(ctx,
dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"),
):
"""Rolle einen oder mehrere Würfel verdeckt"""
@ -159,7 +168,7 @@ async def gmroll(ctx,
class MyModal(Modal):
def __init__(self) -> None:
self.message_id = 0
super().__init__("Emojitext")
super().__init__(title="Emojitext")
self.add_item(InputText(label="Dein Text:", placeholder="Jeder Buchstabe nur einmal!"))
def set_message_id(self, message_id):
self.message_id = message_id
@ -169,34 +178,16 @@ class MyModal(Modal):
original_message = await interaction.channel.fetch_message(self.message_id)
for x in list(emojitext):
await original_message.add_reaction(alphabet[x])
@bot.message_command(name="Emoji Text", guild_ids=[261575556708040705])
@permissions.has_role(member_role)
@commands.has_role(member_role)
async def emoji_text(ctx, message: discord.Message):
modal = MyModal()
modal.title = "Emoji Bot"
modal.set_message_id(message.id)
await ctx.interaction.response.send_modal(modal)
@bot.command(help="veraltet", usage="", hidden=True)
@is_member()
async def yesno(ctx):
await ctx.message.delete()
await ctx.send(content="Sorry das geht so nicht. Der Befehl hat sich geändert in !vote... für mehr Informationen schreib bitte !help oder frage deinen Admin oder Apotheker. Liebste Grüße, SecondBot <3", delete_after=20.0)
@bot.command(help="Zeigt alte Hilfe", usage="")
@is_member()
async def helpme(ctx):
if admin(ctx):
admin_text = "\n\n!add = Hinzufügen einer Rolle mit Textchannel und hinzufügen von Usern zur Rolle\nNutzung: !add \"<Rolle>\" <User Mentions>\n\n!labor = bringt dich ins Labor :)\nNutzung: !labor\n\n!start = Starte ne Runde PnP\nNutzung: !start @Rolle\n\n!stop = Beende die gestartete Runde PnP\nNutzung: !stop\n\n!purge = Löschen von Nachrichten\nNutzung: !purge all|<Anzahl>|x minutes/hours/days/weeks\n\n!prune - kickt Member ohne Rolle, die 30 Tage nicht online waren\nNutzung: !prune"
else:
admin_text = ""
em = discord.Embed(title="Hilfe",description="!survey = Umfrage mit mehreren Antwortmöglichkeiten\nNutzung: !survey <Frage> | <Antwort1> | <Antwort2> ...\n\n!vote = Ja/Nein Umfrage\nNutzung: !vote <Frage>\n\n!love = zeige einem User Liebe\nNutzung: !love <@User1> <@User2> ...\n\n!roll = Rolle einen oder mehrere Würfel\nNutzung: !roll <anzahl_optional>W<seitenzahl> (z.B. !roll W20 oder !roll 10W6)%s" % admin_text, colour=0x00FF00)
if ctx.author.dm_channel == None:
await ctx.author.create_dm()
await ctx.author.dm_channel.send(embed=em)
@bot.command(help="Umfrage mit mehreren Antwortmöglichkeiten", usage="<Frage> | <Antwort1> | <Antwort2> ...")
@is_member()
async def survey(ctx, *, arg):
@ -210,8 +201,8 @@ async def survey(ctx, *, arg):
desc = desc + emojinumbers[z] + " - " + y + "\n"
z = z + 1
em = discord.Embed(title=question, description=desc, colour=0x00E0FF)
em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url)
ask_msg = await ctx.send(content="||@here||",embed=em)
em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url)
ask_msg = await ctx.send(content="||@everyone||",embed=em)
a = 0
for x in emojinumbers:
if a < z and a != 0:
@ -235,7 +226,7 @@ async def surveyedit(ctx, *, arg):
desc = desc + emojinumbers[z] + " - " + y + "\n"
z = z + 1
em = discord.Embed(title=question, description=desc, colour=0x00E0FF)
em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url)
em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url)
survey_msg = await ctx.channel.fetch_message((int(survey_id)))
await survey_msg.edit(embed=em)
@ -244,8 +235,8 @@ async def surveyedit(ctx, *, arg):
async def vote(ctx, *, arg):
await ctx.message.delete()
em = discord.Embed(description=arg, colour=0x00E0FF)
em.set_author(name=ctx.author.display_name, url=discord.Embed.Empty, icon_url=ctx.author.avatar.url)
ask_msg = await ctx.send(content="||@here||",embed=em)
em.set_author(name=ctx.author.display_name, url=None, icon_url=ctx.author.avatar.url)
ask_msg = await ctx.send(content="||@everyone||",embed=em)
for x in ["", "", ""]:
await ask_msg.add_reaction(x)
await ask_msg.create_thread(name="Diskussion")
@ -265,11 +256,14 @@ async def start(ctx, role_mention):
pnp_voice = await ctx.guild.fetch_channel(435869507123281920)
role = ctx.message.role_mentions[0]
em = discord.Embed(description='gespieltes PnP: %s\nTeilnehmer (zum Start):' % role.mention, colour=0x00770d)
move_members = []
for c in ctx.guild.voice_channels:
for m in c.members:
if role in m.roles:
await m.move_to(pnp_voice)
move_members.append(m)
em.add_field(name=":white_check_mark: " + m.display_name, value = m.mention + " ist am Start! Juhu!", inline=False)
for m in move_members:
await m.move_to(pnp_voice)
start_msg = await pnp_info.send(content=":game_die: **INFO: PnP Sitzung gestartet!**",embed=em)
text_file = open("start_id.txt", "w")
text_file.write(str(start_msg.id))
@ -384,16 +378,25 @@ async def purge(ctx, *, arg):
deleted = await ctx.channel.purge(limit=limit)
await ctx.send(content='Ich habe {} Nachrichten gelöscht.'.format(len(deleted)), delete_after=5.0)
@bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...", hidden=True)
@bot.command(help="zeige einem User Liebe", usage="<@User1> <@User2> ...")
@is_member()
async def love(ctx, *, arg):
async def liebe(ctx, *, arg):
await ctx.message.delete()
for user in ctx.message.mentions:
if user.dm_channel == None:
await user.create_dm()
await user.dm_channel.send("❤️")
await user.dm_channel.send("❤️ von {}".format(ctx.author.display_name))
@bot.command(help="kickt Member ohne Rolle, die 30 Tage nicht online waren", usage="")
@bot.command(help="zeige einem User Hiebe", usage="<@User1> <@User2> ...")
@is_member()
async def hiebe(ctx, *, arg):
await ctx.message.delete()
for user in ctx.message.mentions:
if user.dm_channel == None:
await user.create_dm()
await user.dm_channel.send("HIEBE :punch: von {}".format(ctx.author.display_name))
@bot.command(help="kickt Member ohne Rolle, die 7 Tage nicht online waren", usage="")
@is_admin()
async def prune(ctx):
await ctx.message.delete()
@ -406,8 +409,8 @@ async def prune(ctx):
await ctx.send(content="Zeit ausgelaufen", delete_after=5.0)
elif view.value:
await question.delete()
deleted = await ctx.guild.prune_members(days=30)
await ctx.send(content='Ich habe {} Leichen beseitigt.'.format(deleted), delete_after=5.0)
deleted = await ctx.guild.prune_members(days=7)
await ctx.send(content='Ich habe {} Leiche(n) beseitigt.'.format(deleted), delete_after=5.0)
else:
await question.delete()
@ -443,4 +446,4 @@ async def roll(ctx, arg):
em = discord.Embed(title=rolle, description=rolltotal, colour=0x009933)
await ctx.send(embed=em)
bot.run(token)
bot.run(token)

View file

@ -4,6 +4,7 @@ import time
import datetime
import random
import os
import sys
from os import system
from os import environ
from discord.ext import commands
@ -22,6 +23,9 @@ bot = commands.Bot(intents=intents, command_prefix=prefix)
@bot.event
async def on_connect():
print("Bot ready on Version %s..." % discord.__version__)
await bot.sync_commands(unregister_guilds=[261575556708040705])
await bot.sync_commands(commands=[], guild_ids=[261575556708040705])
await bot.register_commands(commands=[], guild_id=261575556708040705)
await bot.close()
os._exit(0)
bot.run(token)

3
renovate.json Normal file
View file

@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

View file

@ -1 +1 @@
py-cord==2.0.0b5
py-cord==2.6.1

42
survey.py Normal file
View file

@ -0,0 +1,42 @@
import discord
import asyncio
import time
import datetime
import random
import os
from os import system
from os import environ
from discord.ext import commands
from discord.commands import Option
from discord.commands import permissions
from discord.ui import InputText, Modal
def left(s, amount):
return s[:amount]
def right(s, amount):
return s[-amount:]
def mid(s, offset, amount):
return s[offset:offset+amount]
token = os.environ['TOKEN']
survey_channel = int(os.environ['SURVEY_CHANNEL'])
mention_id = int(os.environ['MENTION_ID'])
guild_id = int(os.environ['GUILD_ID'])
runtime = 48
bot = discord.Bot(description=None)
@bot.event
async def on_ready():
print("Bot ready on Version %s..." % discord.__version__)
# build survey
po = discord.Poll(question="Wie habt ihr nächste Woche Zeit?", answers=[discord.PollAnswer(text="Montag", emoji="1\u20E3"), discord.PollAnswer(text="Dienstag", emoji="2\u20E3"), discord.PollAnswer(text="Mittwoch", emoji="3\u20E3"), discord.PollAnswer(text="Donnerstag", emoji="4\u20E3"), discord.PollAnswer(text="Freitag", emoji="5\u20E3"), discord.PollAnswer(text="Samstag", emoji="6\u20E3"), discord.PollAnswer(text="Sonntag", emoji="7\u20E3"), discord.PollAnswer(text="keine Zeit", emoji="")], duration=runtime, allow_multiselect=True)
# send message
msg = await bot.get_channel(survey_channel).send(content="||%s||"% bot.get_guild(guild_id).get_role(mention_id).mention ,poll=po)
await msg.create_thread(name="Diskussion")
# close connection
await bot.close()
bot.run(token)