Deprecated ephemeral field (#158)
* Update: ephemeral flag added in place of field * Update: remove unused import * Update: version increment --------- Co-authored-by: Kevin Dang <kevinthedang_1@outlook.com>
This commit is contained in:
@@ -7,7 +7,7 @@ services:
|
||||
build: ./ # find docker file in designated path
|
||||
container_name: discord
|
||||
restart: always # rebuild container always
|
||||
image: kevinthedang/discord-ollama:0.8.2
|
||||
image: kevinthedang/discord-ollama:0.8.3
|
||||
environment:
|
||||
CLIENT_TOKEN: ${CLIENT_TOKEN}
|
||||
OLLAMA_IP: ${OLLAMA_IP}
|
||||
@@ -28,7 +28,6 @@ services:
|
||||
networks:
|
||||
ollama-net:
|
||||
ipv4_address: ${OLLAMA_IP}
|
||||
|
||||
runtime: nvidia # use Nvidia Container Toolkit for GPU support
|
||||
devices:
|
||||
- /dev/nvidia0
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "discord-ollama",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "discord-ollama",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"discord.js": "^14.17.3",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-ollama",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"description": "Ollama Integration into discord",
|
||||
"main": "build/index.js",
|
||||
"exports": "./build/index.js",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js'
|
||||
import { Client, CommandInteraction, ApplicationCommandOptionType, MessageFlags } from 'discord.js'
|
||||
import { openConfig, SlashCommand, UserCommand } from '../utils/index.js'
|
||||
|
||||
export const Capacity: SlashCommand = {
|
||||
@@ -28,7 +28,7 @@ export const Capacity: SlashCommand = {
|
||||
|
||||
interaction.reply({
|
||||
content: `Max message history is now set to \`${interaction.options.get('context-capacity')?.value}\``,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Channel, Client, CommandInteraction, TextChannel } from 'discord.js'
|
||||
import { Channel, Client, CommandInteraction, MessageFlags, TextChannel } from 'discord.js'
|
||||
import { clearChannelInfo, SlashCommand, UserCommand } from '../utils/index.js'
|
||||
|
||||
export const ClearUserChannelHistory: SlashCommand = {
|
||||
@@ -24,12 +24,12 @@ export const ClearUserChannelHistory: SlashCommand = {
|
||||
if (successfulWipe)
|
||||
interaction.reply({
|
||||
content: `History cleared in **this channel** cleared for **${interaction.user.username}**.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
else
|
||||
interaction.reply({
|
||||
content: `History was not be found for **${interaction.user.username}** in **this channel**.\n\nPlease chat with **${client.user?.username}** to start a chat history.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ApplicationCommandOptionType, Client, CommandInteraction } from 'discord.js'
|
||||
import { ApplicationCommandOptionType, Client, CommandInteraction, MessageFlags } from 'discord.js'
|
||||
import { UserCommand, SlashCommand } from '../utils/index.js'
|
||||
import { ollama } from '../client.js'
|
||||
import { ModelResponse } from 'ollama'
|
||||
@@ -31,7 +31,7 @@ export const DeleteModel: SlashCommand = {
|
||||
if (!interaction.memberPermissions?.has('Administrator')) {
|
||||
interaction.reply({
|
||||
content: `${interaction.commandName} is an admin command.\n\nPlease contact a server admin to pull the model you want.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export const DeleteModel: SlashCommand = {
|
||||
// could not delete the model
|
||||
interaction.reply({
|
||||
content: `Could not delete the **${modelInput}** model. It probably doesn't exist or you spelled it incorrectly.\n\nPlease try again if this is a mistake.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js'
|
||||
import { Client, CommandInteraction, ApplicationCommandOptionType, MessageFlags } from 'discord.js'
|
||||
import { AdminCommand, openConfig, SlashCommand } from '../utils/index.js'
|
||||
|
||||
export const Disable: SlashCommand = {
|
||||
@@ -25,7 +25,7 @@ export const Disable: SlashCommand = {
|
||||
if (!interaction.memberPermissions?.has('Administrator')) {
|
||||
interaction.reply({
|
||||
content: `${interaction.commandName} is an admin command.\n\nPlease contact an admin to use this command for you.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export const Disable: SlashCommand = {
|
||||
|
||||
interaction.reply({
|
||||
content: `${client.user?.username} is now **${interaction.options.get('enabled')?.value ? "enabled" : "disabled"}**.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ApplicationCommandOptionType, Client, CommandInteraction } from 'discord.js'
|
||||
import { ApplicationCommandOptionType, Client, CommandInteraction, MessageFlags } from 'discord.js'
|
||||
import { openConfig, SlashCommand, UserCommand } from '../utils/index.js'
|
||||
|
||||
export const MessageStream: SlashCommand = {
|
||||
@@ -28,7 +28,7 @@ export const MessageStream: SlashCommand = {
|
||||
|
||||
interaction.reply({
|
||||
content: `Message streaming is now set to: \`${interaction.options.get('stream')?.value}\``,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ApplicationCommandOptionType, Client, CommandInteraction } from "discord.js"
|
||||
import { ApplicationCommandOptionType, Client, CommandInteraction, MessageFlags } from "discord.js"
|
||||
import { ollama } from "../client.js"
|
||||
import { ModelResponse } from "ollama"
|
||||
import { UserCommand, SlashCommand } from "../utils/index.js"
|
||||
@@ -31,7 +31,7 @@ export const PullModel: SlashCommand = {
|
||||
if (!interaction.memberPermissions?.has('Administrator')) {
|
||||
interaction.reply({
|
||||
content: `${interaction.commandName} is an admin command.\n\nPlease contact a server admin to pull the model you want.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Client, CommandInteraction } from 'discord.js'
|
||||
import { Client, CommandInteraction, MessageFlags } from 'discord.js'
|
||||
import { AdminCommand, SlashCommand } from '../utils/index.js'
|
||||
|
||||
export const Shutoff: SlashCommand = {
|
||||
@@ -18,7 +18,7 @@ export const Shutoff: SlashCommand = {
|
||||
if (!interaction.memberPermissions?.has('Administrator')) {
|
||||
interaction.reply({
|
||||
content: `**Shutdown Aborted:**\n\n${interaction.user.tag}, You do not have permission to shutoff **${client.user?.tag}**.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
return // stop from shutting down
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export const Shutoff: SlashCommand = {
|
||||
// Shutoff cleared, do it
|
||||
interaction.reply({
|
||||
content: `${client.user?.tag} is shutting down.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
|
||||
console.log(`[Command: shutoff] ${client.user?.tag} is shutting down.`)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChannelType, Client, CommandInteraction, TextChannel, ThreadChannel } from 'discord.js'
|
||||
import { ChannelType, Client, CommandInteraction, MessageFlags, TextChannel, ThreadChannel } from 'discord.js'
|
||||
import { AdminCommand, openChannelInfo, SlashCommand } from '../utils/index.js'
|
||||
|
||||
export const ThreadCreate: SlashCommand = {
|
||||
@@ -26,7 +26,7 @@ export const ThreadCreate: SlashCommand = {
|
||||
// user only reply
|
||||
return interaction.reply({
|
||||
content: `I can help you in <#${thread.id}> below.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChannelType, Client, CommandInteraction, TextChannel, ThreadChannel } from 'discord.js'
|
||||
import { ChannelType, Client, CommandInteraction, MessageFlags, TextChannel, ThreadChannel } from 'discord.js'
|
||||
import { AdminCommand, openChannelInfo, SlashCommand } from '../utils/index.js'
|
||||
|
||||
export const PrivateThreadCreate: SlashCommand = {
|
||||
@@ -27,7 +27,7 @@ export const PrivateThreadCreate: SlashCommand = {
|
||||
// user only reply
|
||||
return interaction.reply({
|
||||
content: `I can help you in <#${thread.id}>.`,
|
||||
ephemeral: true
|
||||
flags: MessageFlags.Ephemeral
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user