Public/Private Chat Threads (#62)

* add: validate thread creation in ollama channel

* rm: channel_id variable

* add: short notes for threads

* update: openFile to openConfig for clarity

* update: test ci runs on master

* add: notes for work

* add: basic chat storing via json

* update: stores entire msgHist according to capacity

* add: removes json file if thread is deleted

* add: chats with independent histories

* add: private vs public threads

* update: validate threads made by ollama for chats

* update: cleanup and version increment
This commit is contained in:
Kevin Dang
2024-06-10 19:47:08 -07:00
committed by GitHub
parent 9f77c5287f
commit 1973b1d3ae
22 changed files with 199 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
import { ApplicationCommandOptionType, ChannelType, Client, CommandInteraction } from 'discord.js'
import { SlashCommand } from '../utils/commands.js'
import { openFile } from '../utils/jsonHandler.js'
import { openConfig } from '../utils/jsonHandler.js'
export const MessageStream: SlashCommand = {
name: 'message-stream',
@@ -20,10 +20,10 @@ export const MessageStream: SlashCommand = {
run: async (client: Client, interaction: CommandInteraction) => {
// verify channel
const channel = await client.channels.fetch(interaction.channelId)
if (!channel || channel.type !== ChannelType.GuildText) return
if (!channel || channel.type !== ChannelType.PublicThread) return
// save value to json and write to it
openFile('config.json', interaction.commandName, interaction.options.get('stream')?.value)
openConfig('config.json', interaction.commandName, interaction.options.get('stream')?.value)
interaction.reply({
content: `Message streaming preferences for embed set to: \`${interaction.options.get('stream')?.value}\``,