Compare commits

...

5 Commits

Author SHA1 Message Date
Chris Nutter 9a89ef1c51 removed thread feature 2024-05-10 11:46:50 -07:00
Chris Nutter 7aea5223b7 Update Dockerfile 2024-05-10 11:41:45 -07:00
Chris Nutter 9e94811d81 updated python 2024-05-10 11:40:32 -07:00
Chris Nutter ecaf5c701b Update discollama.py 2024-05-10 11:39:13 -07:00
Chris Nutter 3c956d269e disabled thread and added password arg 2024-05-10 11:36:48 -07:00
2 changed files with 7 additions and 6 deletions

View File

@ -1,10 +1,10 @@
FROM python:3.11.6-alpine
FROM python:3.11.9-alpine
RUN apk add --no-cache build-base libffi-dev
RUN pip install poetry
WORKDIR /mnt
COPY pyproject.toml poetry.lock .
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root --only main
COPY . .

View File

@ -39,8 +39,8 @@ class Response:
await self.r.edit(content=value + end)
return
if self.channel.type == discord.ChannelType.text:
self.channel = await self.channel.create_thread(name='Discollama Says', message=self.message, auto_archive_duration=60)
#if self.channel.type == discord.ChannelType.text:
# self.channel = await self.channel.create_thread(name='Ollama Says', message=self.message, auto_archive_duration=60)
self.r = await self.channel.send(value)
@ -67,7 +67,7 @@ class Discollama:
permissions=discord.Permissions(
read_messages=True,
send_messages=True,
create_public_threads=True,
create_public_threads=False,
),
scopes=['bot'],
),
@ -166,6 +166,7 @@ def main():
parser.add_argument('--redis-host', default=os.getenv('REDIS_HOST', '127.0.0.1'), type=str)
parser.add_argument('--redis-port', default=os.getenv('REDIS_PORT', 6379), type=int)
parser.add_argument('--redis-password', default=os.getenv('REDIS_PASSWORD', ''), type=str)
parser.add_argument('--buffer-size', default=32, type=int)
@ -177,7 +178,7 @@ def main():
Discollama(
ollama.AsyncClient(host=f'{args.ollama_scheme}://{args.ollama_host}:{args.ollama_port}'),
discord.Client(intents=intents),
redis.Redis(host=args.redis_host, port=args.redis_port, db=0, decode_responses=True),
redis.Redis(host=args.redis_host, port=args.redis_port, password=args.redis_password, db=0, decode_responses=True),
model=args.ollama_model,
).run(os.environ['DISCORD_TOKEN'])