Compare commits

..

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

5 changed files with 47 additions and 34 deletions

View file

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

View file

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

View file

@ -1,22 +1,22 @@
# SECOND BOT # 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 der Bot für den SecondHemd Discord
# Latest # Latest
## Build ## Build
``` ```
docker build -t secondhemd/shbot:latest . docker build -t docker-registry.cxservers.com/aaron-riedel/shbot:latest .
``` ```
## Run ## 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 ## Docker compose
``` ```
services: services:
bot: bot:
image: secondhemd/shbot:latest image: docker-registry.cxservers.com/aaron-riedel/shbot:latest
container_name: shbot container_name: shbot
restart: unless-stopped restart: unless-stopped
environment: environment:
@ -27,17 +27,17 @@ services:
# Development # Development
## Build ## Build
``` ```
docker build -t secondhemd/shbot:dev . docker build -t docker-registry.cxservers.com/aaron-riedel/shbot:dev .
``` ```
## Run ## 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 ## Docker compose
``` ```
services: services:
bot: bot:
image: secondhemd/shbot:dev image: docker-registry.cxservers.com/aaron-riedel/shbot:dev
container_name: shbot container_name: shbot
restart: unless-stopped restart: unless-stopped
environment: environment:

12
bot.py
View file

@ -101,7 +101,7 @@ class Confirm(discord.ui.View):
@bot.slash_command(guild_ids=[261575556708040705]) @bot.slash_command(guild_ids=[261575556708040705])
@commands.has_role(member_role) @commands.has_role(member_role)
async def roll(ctx, async def roll(ctx,
dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"), dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"),
): ):
"""Rolle einen oder mehrere Würfel""" """Rolle einen oder mehrere Würfel"""
@ -134,7 +134,7 @@ async def roll(ctx,
@bot.slash_command(guild_ids=[261575556708040705]) @bot.slash_command(guild_ids=[261575556708040705])
@commands.has_role(gm_role) @commands.has_role(gm_role)
async def gmroll(ctx, async def gmroll(ctx,
dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"), dice: Option(str, "Würfel den/die du werfen willst. z.B. W20, 3d6", default="W20"),
): ):
"""Rolle einen oder mehrere Würfel verdeckt""" """Rolle einen oder mehrere Würfel verdeckt"""
@ -178,7 +178,7 @@ class MyModal(Modal):
original_message = await interaction.channel.fetch_message(self.message_id) original_message = await interaction.channel.fetch_message(self.message_id)
for x in list(emojitext): for x in list(emojitext):
await original_message.add_reaction(alphabet[x]) await original_message.add_reaction(alphabet[x])
@bot.message_command(name="Emoji Text", guild_ids=[261575556708040705]) @bot.message_command(name="Emoji Text", guild_ids=[261575556708040705])
@commands.has_role(member_role) @commands.has_role(member_role)
@ -414,7 +414,7 @@ async def hiebe(ctx, *, arg):
await user.create_dm() await user.create_dm()
await user.dm_channel.send("HIEBE :punch: von {}".format(ctx.author.display_name)) 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() @is_admin()
async def prune(ctx): async def prune(ctx):
await ctx.message.delete() await ctx.message.delete()
@ -427,8 +427,8 @@ async def prune(ctx):
await ctx.send(content="Zeit ausgelaufen", delete_after=5.0) await ctx.send(content="Zeit ausgelaufen", delete_after=5.0)
elif view.value: elif view.value:
await question.delete() await question.delete()
deleted = await ctx.guild.prune_members(days=7) deleted = await ctx.guild.prune_members(days=30)
await ctx.send(content='Ich habe {} Leiche(n) beseitigt.'.format(deleted), delete_after=5.0) await ctx.send(content='Ich habe {} Leichen beseitigt.'.format(deleted), delete_after=5.0)
else: else:
await question.delete() await question.delete()

View file

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