Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteHodok authored Jun 14, 2023
1 parent 8b0c8d7 commit b2283f8
Show file tree
Hide file tree
Showing 2 changed files with 305 additions and 0 deletions.
246 changes: 246 additions & 0 deletions cookie.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
[
{
"domain": ".bing.com",
"expirationDate": 1721236339.226132,
"hostOnly": false,
"httpOnly": false,
"name": "SRCHUSR",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "DOB=20230105&T=168600"
},
{
"domain": ".bing.com",
"expirationDate": 16867688951,
"hostOnly": false,
"httpOnly": true,
"name": "SUID",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "A"
},
{
"domain": ".bing.com",
"expirationDate": 305726,
"hostOnly": false,
"httpOnly": false,
"name": "SRCHHPGUSR",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "SRCHLANG=ru&PV=10.0.0&BRW69&SCW=1850&SCH=2822&DPR=1.0&UTC=360&DM=0&HV=168667638H=969&EXLTT=15&WTS=63817579252"
},
{
"domain": ".bing.com",
"expirationDate": 1721234699.689229,
"hostOnly": false,
"httpOnly": false,
"name": "ANON",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "A=149E58F1F676=1c3a&W=1"
},
{
"domain": ".bing.com",
"hostOnly": false,
"httpOnly": false,
"name": "_SS",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": true,
"storeId": null,
"value": "SID=19B2EC073F9D617E07C"
},
{
"domain": ".bing.com",
"expirationDate": 1687884299.689189,
"hostOnly": false,
"httpOnly": false,
"name": "_U",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "1OT7VfVuWhJYwI7QJCRHaxPhNIx4lPUQ5a9yaSsCvZoSTDLy38fFUOURbq5jp4XckmsrX0esM51hUdlae_Ocg74n5fuhKBr7nWPeHD0F-0Ru_dNaNhKyjyakAqZHspxrjiobe_OjDlo6uVQMyMHVBMlTuYWqn48hzxr3mZPktBMPKo7TrTNRUqYAA-w"
},
{
"domain": ".bing.com",
"expirationDate": 1736059389.18999,
"hostOnly": false,
"httpOnly": false,
"name": "SRCHD",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "AF=NOFORM"
},
{
"domain": ".bing.com",
"expirationDate": 1706596989.189957,
"hostOnly": false,
"httpOnly": true,
"name": "_EDGE_V",
"path": "/",
"sameSite": null,
"secure": false,
"session": false,
"storeId": null,
"value": "1"
},
{
"domain": ".bing.com",
"expirationDate": 1697305142.442565,
"hostOnly": false,
"httpOnly": false,
"name": "NAP",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "V=1.9&E=1be0&C=yGeoLBxbXELmx9cwHXaToHOUmUpaur7bg&W=1"
},
{
"domain": ".bing.com",
"expirationDate": 1715336468.563388,
"hostOnly": false,
"httpOnly": false,
"name": "_RwBf",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "ilt=0&ihpd=0&ispd=0&rc=0&rb=0&gb=0&rg=0&pc=0&mtu=0&rbb=0&g=0&cid=&clo=0&v=0&l=0001-01-01T00:00000000+00:00&ts=2023-05-10T10:21:07.2424051+00:00&rwred=0&wls=2&lka=0&lkt=0&TH="
},
{
"domain": ".bing.com",
"expirationDate": 1713522676.897083,
"hostOnly": false,
"httpOnly": false,
"name": "_UR",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "QS=0&TQS=0"
},
{
"domain": ".bing.com",
"hostOnly": false,
"httpOnly": true,
"name": "_EDGE_S",
"path": "/",
"sameSite": null,
"secure": false,
"session": true,
"storeId": null,
"value": "SID=19B2EC073F9D617E3E83607C"
},
{
"domain": "www.bing.com",
"expirationDate": 1720372340.441123,
"hostOnly": true,
"httpOnly": true,
"name": "MUIDB",
"path": "/",
"sameSite": null,
"secure": false,
"session": false,
"storeId": null,
"value": "0A8488685E02FC56775"
},
{
"domain": ".bing.com",
"expirationDate": 1721236339.44122,
"hostOnly": false,
"httpOnly": true,
"name": "USRLOC",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "HS=1&ELOC=LAT=54.9779319763181%D0%BA%2C%20%D0%9E%D0%BC%D1%81%D0%BA%D0%B0%D1%8F%20%D0%BE%D0%B1%D0%BB%D0%B0%D1%81%D1%82%D1%8C|ELT=0|&CLOC=LAT=40.9291|LON=-72.6494|A=642538|TS=230613171216|SRC=I"
},
{
"domain": ".bing.com",
"expirationDate": 1713522676.897798,
"hostOnly": false,
"httpOnly": false,
"name": "_HPVN",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "CS=eyJQbiI6eyJDbiI6MywiU3QiOjAiOjAsIlFzIjowLCJQcm9kIjoiSCJ9LCJReiI6eyJDbiI6MywiU3QiOjAsIlFzIjowLCJQcm9kIjoiVCJ9LCJBcCI6dHJ1ZSwiTXV0ZSI6dHJ1ZSwiTGFkIjoiMjAyMy0wMy0xNlQwMDowMDowMFoiLCJJb3RkIjowLCJHd2IiOjAsIkRmdCI6bnVsbCwiTXZzIjowLCJGbHQiOjAsIkltcCI6MTV9"
},
{
"domain": ".bing.com",
"expirationDate": 1721236334.405687,
"hostOnly": false,
"httpOnly": false,
"name": "ABDEF",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "V=13&ABDV=13&MRMRB=0"
},
{
"domain": ".bing.com",
"expirationDate": 1719132049.82149,
"hostOnly": false,
"httpOnly": false,
"name": "MUID",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "0A8488685E05"
},
{
"domain": ".bing.com",
"expirationDate": 1736059389.190012,
"hostOnly": false,
"httpOnly": false,
"name": "SRCHUID",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": null,
"value": "V=2&GUID=3339AC4220FBA9B&dmnchg=1"
},
{
"domain": ".bing.com",
"hostOnly": false,
"httpOnly": false,
"name": "WLS",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": true,
"storeId": null,
"value": "C=2b850f43d68ac98c&N=vlad"
}
]
59 changes: 59 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import os
import re
from EdgeGPT import Chatbot, ConversationStyle
import interactions

TOKEN = "" # Тут токен твоего бота
COOKIE_PATH = 'cookie.json'
bot = interactions.Client(token=TOKEN)
EDGES = {}
my_conversation_style = ConversationStyle.balanced

guild_ids = [""] # Айдишка твоего сервера-канала
#Обязательно заюзай как только включил бота
@interactions.slash_command(
name="start",
description="Старт бота"
)
async def _start(ctx: interactions.SlashContext):
global EDGES
EDGES[ctx.author.id] = Chatbot(cookie_path=COOKIE_PATH)
await ctx.send(f"Ку, {ctx.author.name}! Юзай /help для большей информации.")

@interactions.slash_command(
name="help",
description="Показать список команд",
)
async def _help(ctx: interactions.SlashContext):
response = "Введи /help для инфы\nДля смены стиля, введи /switch и следуй: \ncreative (Creative)\nbalanced (Balanced)\nprecise (Strict)"
await ctx.send(response)

@interactions.slash_command(
name="switch",
description="Свитч стиля беседы",
)
async def _switch(ctx: interactions.SlashContext, style: str):
global my_conversation_style
styles = {
"creative": ConversationStyle.creative,
"balanced": ConversationStyle.balanced,
"precise": ConversationStyle.precise
}
my_conversation_style = styles[style]
await ctx.send(f"Current style: {style.capitalize()}")

@interactions.slash_command(
name="ask",
description="Задай мне вопрос",
)
async def _ask(ctx: interactions.SlashContext, question: str):
global EDGES
edge = EDGES.get(ctx.author.id)
if edge is None:
await ctx.send("Сначала ты должен запустить бота! Use /start")
return
response = edge.chat(question, my_conversation_style)
await ctx.send(response)

bot.start()

0 comments on commit b2283f8

Please sign in to comment.