Merge branch 'ikechan8370:v2' into v2

This commit is contained in:
ifeif 2023-12-03 20:38:10 +08:00 committed by GitHub
commit 4a6cad2e4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 79 additions and 71 deletions

15
utils/bot.js Normal file
View file

@ -0,0 +1,15 @@
export function getBots () {
if (Bot.uin === 88888) {
// 找适配器
let adapters = Bot.adapter
return adapters?.map(uin => Bot[uin])
} else if (Bot.adapter && Bot.adapter.length > 0) {
let bots = [Bot]
Bot.adapter.forEach(uin => {
bots.push(Bot[uin])
})
return bots
} else {
return [Bot]
}
}

View file

@ -136,7 +136,7 @@ export class ClaudeAIClient {
attachments,
completion: {
incremental: true,
model: 'claude-2',
model: 'claude-2.1',
prompt: text,
timezone: 'Asia/Hong_Kong'
}

View file

@ -848,6 +848,7 @@ export function getMaxModelTokens (model = 'gpt-3.5-turbo') {
}
export function getUin (e) {
if (e?.self_id) return e.self_id
if (e?.bot?.uin) return e.bot.uin
if (Array.isArray(Bot.uin)) {
if (Config.trssBotUin && Bot.uin.indexOf(Config.trssBotUin) > -1) { return Config.trssBotUin } else {