From cea0ba39bcd7fd5d3e0cd5d62b74857c3ca1b08b Mon Sep 17 00:00:00 2001 From: cybrneko Date: Sat, 10 May 2025 00:19:54 -0500 Subject: [PATCH] initial commit of my fork of the code --- bot.py | 14 +++++++------- docker-compose.yaml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bot.py b/bot.py index 87c2c69..d631e76 100644 --- a/bot.py +++ b/bot.py @@ -116,7 +116,7 @@ class Bot: # pull the model # await self.ollama.pull(self.model) - activity = discord.Activity(name='Status', state=f'Hi, I\'m {self.bot_name.title()}! I only respond to mentions.', type=discord.ActivityType.custom) + activity = discord.Activity(name='Status', state=f'Hi, I\'m {self.bot_name.title()}. Don\'t talk to me.', type=discord.ActivityType.custom) await self.discord.change_presence(activity=activity) logging.info( @@ -168,19 +168,19 @@ class Bot: # Do not respond with llm in private messages if isinstance(message.channel, discord.DMChannel): - response = DiscordResponse(message) - if self.discord.user.mentioned_in(message): - await response.write(message, 'I am sorry, I am unable to respond in private messages.') - return + response = DiscordResponse(message) + if self.discord.user.mentioned_in(message): + await response.write(message, 'I am sorry, I am unable to respond in private messages.') + return - # Do not respond to messages that don't mention us + # Do not respond to messages that don't mention us. 0.2 is 20 percent chance to answer anyway. if not self.discord.user.mentioned_in(message) or message.author.bot or '@everyone' in message.content or '@here' in message.content: # don't respond to messages that don't mention us, but save it for context await self.save_message(str(message.channel.id), self.message(message, message.content), 'user') logging.info('Message saved for context in %s, but it was not for us', (message.channel.id)) # However, if randomly it does accept the message, and respond. There is a 0.01% chance of it happening. - if (random.random() * 1000) > 0.1: + if (random.random()* 1000) > 0.1: return # Clean message diff --git a/docker-compose.yaml b/docker-compose.yaml index adde11d..01c64fd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -44,7 +44,7 @@ services: image: redis/redis-stack-server:latest restart: always volumes: - - redis:/data + - /portainer/Files/AppData/Config/discordluna/redis:/data networks: - redis expose: