Compare commits

..

No commits in common. "43a01a753ba9e2938f616ead079a92549bac6f17" and "3d0d38eb30b701011f93049e6415c16aab8aa92c" have entirely different histories.

5 changed files with 47 additions and 34 deletions

View file

@ -4,44 +4,52 @@ steps:
- name: docker
image: plugins/docker
settings:
registry: git.ar21.de
username:
from_secret: REGISTRY_USER
from_secret: DOCKER_USERNAME
password:
from_secret: REGISTRY_PASS
repo: git.ar21.de/secondhemd/shbot
from_secret: DOCKER_PASSWORD
repo: secondhemd/shbot
tags: latest
when:
branch:
include:
- master
event:
include:
- push
- name: docker-build
image: plugins/docker
settings:
registry: git.ar21.de
username:
from_secret: REGISTRY_USER
from_secret: DOCKER_USERNAME
password:
from_secret: REGISTRY_PASS
repo: git.ar21.de/secondhemd/shbot
from_secret: DOCKER_PASSWORD
repo: secondhemd/shbot
tags: latest
dry_run: true
when:
branch:
exclude:
- master
event:
exclude:
- push
- name: dev docker
image: plugins/docker
settings:
registry: git.ar21.de
username:
from_secret: REGISTRY_USER
from_secret: DOCKER_USERNAME
password:
from_secret: REGISTRY_PASS
repo: git.ar21.de/secondhemd/shbot
from_secret: DOCKER_PASSWORD
repo: secondhemd/shbot
tags: dev
when:
branch:
include:
- dev
event:
include:
- push
- name: deploy
image: appleboy/drone-ssh
settings:
@ -53,10 +61,14 @@ steps:
port: 22
command_timeout: 2m
script:
- cd /root && docker compose pull shbot && docker compose up -d shbot
- cd /root && docker-compose pull shbot && docker-compose up -d shbot
when:
branch:
include:
- master
event:
include:
- push
- name: deploy dev
image: appleboy/drone-ssh
settings:
@ -68,10 +80,11 @@ steps:
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
- cd /root && docker-compose -f shbot-dev.yaml pull shbot-dev && docker-compose -f shbot-dev.yaml up -d shbot-dev
when:
branch:
include:
- dev
when:
event:
include:
- push

View file

@ -1,4 +1,4 @@
FROM amd64/python:3.11.3-alpine3.16
FROM python:3.10.5-alpine3.15
WORKDIR ./
ARG PUID=1000

View file

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

6
bot.py
View file

@ -414,7 +414,7 @@ async def hiebe(ctx, *, arg):
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="")
@bot.command(help="kickt Member ohne Rolle, die 30 Tage nicht online waren", usage="")
@is_admin()
async def prune(ctx):
await ctx.message.delete()
@ -427,8 +427,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=7)
await ctx.send(content='Ich habe {} Leiche(n) beseitigt.'.format(deleted), delete_after=5.0)
deleted = await ctx.guild.prune_members(days=30)
await ctx.send(content='Ich habe {} Leichen beseitigt.'.format(deleted), delete_after=5.0)
else:
await question.delete()

View file

@ -1 +1 @@
py-cord==2.4.1
py-cord==2.0.0rc1