Compare commits

...

5 Commits

Author SHA1 Message Date
44236eacec l 132 indentation error 2022-01-22 13:57:07 +00:00
be43d3e03a Added coroutine to defer response to interaction
This should compensate for the lag in the bot and fix the menu bug
2022-01-22 13:54:02 +00:00
f5097a9d2d Defined specific version number for image
Later images break wheel again.
2022-01-21 21:37:24 +00:00
42cf3afcb4 Bugfix: membership restriction scanning non-game servers 2022-01-21 21:24:44 +00:00
6ec8613b7f Added container name 2021-08-07 08:50:07 +01:00
5 changed files with 15 additions and 4 deletions

View File

@ -1,7 +1,7 @@
FROM python:slim FROM python:3.9.6-slim
COPY . /usr/src/app COPY . /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
RUN apt-get update -y && apt-get upgrade -y && apt-get install libopus0 -y && \ RUN apt-get update -y && apt-get upgrade -y && apt-get install libopus0 -y && \
pip install --upgrade pip && pip install -r requirements.txt && \ pip install --upgrade pip setuptools wheel && pip install -r requirements.txt && \
apt-get autoremove -y apt-get autoremove -y
CMD python3 -u ./bot.py CMD python3 -u ./bot.py

View File

@ -17,6 +17,15 @@ class PitchListener(commands.Cog, name='Pitch Listener'):
def __init__(self, client): def __init__(self, client):
self.client = client self.client = client
@commands.Cog.listener(name='on_component')
async def _response_defer(self, ctx:ComponentContext):
pitches = yaml_load(pitchesFile)
guildStr = str(ctx.guild.id)
if not pitches.get(guildStr, {}): return # If no pitches for current guild, ignore.
[timeslot] = [*pitches[guildStr]]
if ctx.origin_message.id not in pitches[guildStr][timeslot]['messages'] + [pitches[guildStr][timeslot]['control']]: return # If the context id is not in the pitch menu, ignore
await ctx.defer(hidden = True)
@commands.Cog.listener(name='on_component') @commands.Cog.listener(name='on_component')
async def _pitch_listener(self, ctx:ComponentContext): async def _pitch_listener(self, ctx:ComponentContext):
conf = yaml_load(configFile) conf = yaml_load(configFile)

View File

@ -23,7 +23,8 @@ class RestrictionListener(commands.Cog, name='Membership Restriction Listener'):
lookup = yaml_load(lookupFile) lookup = yaml_load(lookupFile)
if not conf[guildStr].get('restrict',False): return if not conf[guildStr].get('restrict',False): return
if message.author.bot: return if message.author.bot: return
if str(message.channel.category) in categories[guildStr]: return if message.channel.category is None: return
if str(message.channel.category.id) not in categories[guildStr]: return
if (set(message.author.roles) & set([message.guild.get_role(x) for x in conf[guildStr]['roles']['admin']]) or message.author == message.guild.owner): return if (set(message.author.roles) & set([message.guild.get_role(x) for x in conf[guildStr]['roles']['admin']]) or message.author == message.guild.owner): return
if set(message.author.roles) & set([message.guild.get_role(x) for x in conf[guildStr]['membership']]): return if set(message.author.roles) & set([message.guild.get_role(x) for x in conf[guildStr]['membership']]): return
if message.channel.overwrites_for(message.author).manage_channels: return if message.channel.overwrites_for(message.author).manage_channels: return

View File

@ -3,6 +3,7 @@ version: '3.5'
services: services:
geasbot-app: geasbot-app:
build: ./app build: ./app
container_name: geas_bot
volumes: volumes:
- ./app:/usr/src/app - ./app:/usr/src/app
restart: unless-stopped restart: unless-stopped