|
|
|
@ -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'])
|
|
|
|
|
|
|
|
|
|