From fd971491ea6f5c94e1fb16395871381ed8047aa6 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Sat, 21 May 2022 16:29:35 -0700 Subject: [PATCH] Add business card reply, switch the number we tag the container with to an IID (unique per project) --- .gitlab-ci.yml | 4 ++-- app/bot.py | 15 ++++++++++----- app/requirements.txt | 0 helm/values.yaml | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) mode change 100644 => 100755 app/requirements.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43cd935f..712d1eef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,9 +37,9 @@ build_and_push_container: - echo "Wait for Docker daemon at tcp://localhost:2375" - while ! nc -z localhost 2375; do sleep 0.1; done # Wait until docker socket is available - docker login -u ldooks -p $DOCKER_ACCESS_TOKEN - - docker build -t ldooks/dragon-bot:$CI_PIPELINE_ID -t ldooks/dragon-bot:latest . + - docker build -t ldooks/dragon-bot:$CI_PIPELINE_IID -t ldooks/dragon-bot:latest . - docker push ldooks/dragon-bot:latest - - docker push ldooks/dragon-bot:$CI_PIPELINE_ID + - docker push ldooks/dragon-bot:$CI_PIPELINE_IID rules: - changes: - app/**/* diff --git a/app/bot.py b/app/bot.py index 81d75fd4..73d69541 100755 --- a/app/bot.py +++ b/app/bot.py @@ -1,7 +1,8 @@ #!/usr/local/bin/python -import os -import discord from discord.ext import commands +import discord +import os +import random intents = discord.Intents.default() intents.message_content = True @@ -50,9 +51,13 @@ async def fix_cdn_url(ctx): @bot.listen("on_message") -async def based(ctx): - if ctx.content.lower() == "based": - await ctx.reply("https://i.imgur.com/MejGa23.jpeg") +async def business_card_scene_reploy(ctx): + # if it has an attachment or a link + if ctx.attachments or "https://" in ctx.content: + if random.randint(0, 9) == 0: + await ctx.reply( + "Jesus. This is really super. How'd a nitwit like you get so tasteful?" + ) @bot.listen("on_message") diff --git a/app/requirements.txt b/app/requirements.txt old mode 100644 new mode 100755 diff --git a/helm/values.yaml b/helm/values.yaml index 8fa53cdc..68af915f 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: # Overrides the image tag whose default is the chart appVersion. - tag: "205" + tag: "144" repository: ldooks/dragon-bot pullPolicy: IfNotPresent