Compare commits
7 Commits
72d3432d44
...
master
Author | SHA1 | Date | |
---|---|---|---|
44236eacec | |||
be43d3e03a | |||
f5097a9d2d | |||
42cf3afcb4 | |||
6ec8613b7f | |||
5135786ef6 | |||
3849dc4927 |
@@ -1,6 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## Minor Updates in Version 3.1
|
## Minor Updates in Version 3.0.1
|
||||||
|
|
||||||
- Re-builds the Docker image to use a `python:slim` base instead of `python:buster`, reducing the footprint of the image to a quarter of its previous size.
|
- Re-builds the Docker image to use a `python:slim` base instead of `python:buster`, reducing the footprint of the image to a quarter of its previous size.
|
||||||
|
|
||||||
|
@@ -219,5 +219,6 @@ Programming around this will need a further layer of complexity, involving flags
|
|||||||
|
|
||||||
I have set the member verification prompt to use a global listener to avoid a situation where it creates several backlogged processes when multiple people post sign-ups at the same time.
|
I have set the member verification prompt to use a global listener to avoid a situation where it creates several backlogged processes when multiple people post sign-ups at the same time.
|
||||||
This should also mean that the sign-up prompts should persist over reboots.
|
This should also mean that the sign-up prompts should persist over reboots.
|
||||||
The best possible way of setting this up is probably using functions to dynamically set up and remove component call-backs.
|
Other developers for Discord Components recommended the use of dynamic call-backs, however these do not persist after reboots so are not suitable for this purpose.
|
||||||
Also components do not need to all have unique names, just unique names in the message they are part of.
|
Discord will need to make substantial API updates in the future for rolling out the Threads feature.
|
||||||
|
The bot will need updating again then.
|
||||||
|
2
TODO.md
2
TODO.md
@@ -8,4 +8,4 @@
|
|||||||
|
|
||||||
- [ ] Add support for Discord Threads following Discord Py library update
|
- [ ] Add support for Discord Threads following Discord Py library update
|
||||||
- [ ] Update permission settings for GMs on game channels to support threads
|
- [ ] Update permission settings for GMs on game channels to support threads
|
||||||
- [ ] Change component response architecture to use dynamic callback functions instead of global listeners.
|
- [ ] ~~Change component response architecture to use dynamic callback functions instead of global listeners.~~ Not suitable because it does not provide persistence across reboots.
|
||||||
|
@@ -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
|
@@ -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)
|
||||||
|
@@ -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
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
version: '3.1'
|
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: always
|
restart: unless-stopped
|
Reference in New Issue
Block a user