move help and update dockerfile #7

Merged
crate merged 1 commits from help into main 2025-06-07 18:08:31 +00:00
5 changed files with 64 additions and 58 deletions

View File

@ -1,4 +1,4 @@
FROM python:3.11.10-alpine FROM python:alpine
WORKDIR /usr/src/app WORKDIR /usr/src/app
RUN apk update && \ RUN apk update && \

View File

@ -3,6 +3,7 @@ import asyncio
import discord import discord
from garfpy import ( from garfpy import (
help,
logger, logger,
IPUtils, IPUtils,
aod_message, aod_message,
@ -117,62 +118,7 @@ async def on_message(message):
# GarfBot help # GarfBot help
elif lower.strip() == "garfbot help": elif lower.strip() == "garfbot help":
embed = discord.Embed(title="**Need help?**", color=0x4D4D4D) await help(message)
embed.add_field(
name="hey garfield `prompt`", value="*Responds with text.*", inline=True
)
embed.add_field(
name="garfpic `prompt`", value="*Responds with an image.*", inline=True
)
embed.add_field(
name="garfping `target`",
value="*Responds with iputils-ping result from target.*",
inline=True,
)
embed.add_field(
name="garfdns `target`",
value="*Responds with dns lookup result from target.*",
inline=True,
)
embed.add_field(
name="garfhack `target`",
value="*Responds with nmap scan result from target.*",
inline=True,
)
embed.add_field(
name="garfwiki `query`",
value="*Garfbot looks up a wikipedia article and will summarize it for you.*",
inline=True,
)
embed.add_field(
name="garfshop `item` `zip`",
value="*Responds with 10 grocery items from the nearest Kroger location, cheapest first.*",
inline=True,
)
embed.add_field(
name="garfqr `text`",
value="*Create a QR code for any string up to 1000 characters.*",
inline=True,
)
embed.add_field(
name="garfbot response `add` `trigger` `response`",
value='*Add a GarfBot auto response for your server. Use "quotes" if you like.*',
inline=True,
)
embed.add_field(
name="garfbot response `remove` `trigger`",
value="*Remove a GarfBot auto response for your server.*",
inline=True,
)
embed.add_field(
name="garfbot response `list`",
value="*List current GarfBot auto responses for your server.*",
inline=True,
)
embed.add_field(
name="garfbot help", value="*Show a list of these commands.*", inline=True
)
await message.channel.send(embed=embed)
# Army of Dawn Server only!! # Army of Dawn Server only!!
elif message.guild and message.guild.id == 719605634772893757: elif message.guild and message.guild.id == 719605634772893757:

View File

@ -1,6 +1,7 @@
# garfpy/__init__.py # garfpy/__init__.py
from .log import logger from .log import logger
from .help import help
from .kroger import Kroger from .kroger import Kroger
from .kroger import Kroger from .kroger import Kroger
from .garfai import GarfAI from .garfai import GarfAI

60
garfpy/help.py Normal file
View File

@ -0,0 +1,60 @@
import discord
async def help(message):
embed = discord.Embed(title="**Need help?**", color=0x4D4D4D)
embed.add_field(
name="hey garfield `prompt`", value="*Responds with text.*", inline=True
)
embed.add_field(
name="garfpic `prompt`", value="*Responds with an image.*", inline=True
)
embed.add_field(
name="garfping `target`",
value="*Responds with iputils-ping result from target.*",
inline=True,
)
embed.add_field(
name="garfdns `target`",
value="*Responds with dns lookup result from target.*",
inline=True,
)
embed.add_field(
name="garfhack `target`",
value="*Responds with nmap scan result from target.*",
inline=True,
)
embed.add_field(
name="garfwiki `query`",
value="*Garfbot looks up a wikipedia article and will summarize it for you.*",
inline=True,
)
embed.add_field(
name="garfshop `item` `zip`",
value="*Responds with 10 grocery items from the nearest Kroger location, cheapest first.*",
inline=True,
)
embed.add_field(
name="garfqr `text`",
value="*Create a QR code for any string up to 1000 characters.*",
inline=True,
)
embed.add_field(
name="garfbot response `add` `trigger` `response`",
value='*Add a GarfBot auto response for your server. Use "quotes" if you like.*',
inline=True,
)
embed.add_field(
name="garfbot response `remove` `trigger`",
value="*Remove a GarfBot auto response for your server.*",
inline=True,
)
embed.add_field(
name="garfbot response `list`",
value="*List current GarfBot auto responses for your server.*",
inline=True,
)
embed.add_field(
name="garfbot help", value="*Show a list of these commands.*", inline=True
)
await message.channel.send(embed=embed)

View File

@ -93,7 +93,6 @@ class WeatherAPI:
return {"q": f"{city},{state},{country.upper()}"} return {"q": f"{city},{state},{country.upper()}"}
else: else:
# Check if last part looks like country code
if len(parts[-1]) == 2: if len(parts[-1]) == 2:
city_parts = parts[:-1] city_parts = parts[:-1]
country = parts[-1] country = parts[-1]