mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Start of Armia Hammera
This commit is contained in:
+40
-6
@@ -2,13 +2,16 @@
|
||||
import logging
|
||||
import re
|
||||
import sys
|
||||
import Enum
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
import discord
|
||||
import openai
|
||||
import requests
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
import ai_functions
|
||||
from constants import (
|
||||
ASSISTANTS,
|
||||
@@ -20,7 +23,13 @@ from constants import (
|
||||
SPECJALNE_ZIEMNIACZKI,
|
||||
WORD_REACTIONS,
|
||||
)
|
||||
DM_MODE = "assistant"
|
||||
class Dm_Mode(Enum):
|
||||
ARMIA_HAMMER = 1,
|
||||
SPECJALNY_ZIEMNIACZEK = 2,
|
||||
SEKRETNY_SEKSRET = 3
|
||||
|
||||
|
||||
|
||||
class Events(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
@@ -59,12 +68,39 @@ class Events(commands.Cog):
|
||||
description="Jeśli nie wiesz jak użyć tej komendy to nawet nie próbuj",
|
||||
guild=discord.Object(id=664789470779932693),
|
||||
)
|
||||
async def switch_dm_mode(self, ctx):
|
||||
async def switch_dm_mode(self, ctx, arg: Dm_Mode):
|
||||
|
||||
# add in on message
|
||||
# broadcast avaiable only for me
|
||||
with ctx.typing:
|
||||
if isinstance(ctx.channel, discord.DMChannel):
|
||||
pass
|
||||
for superfryta in SPECJALNE_ZIEMNIACZKI.values():
|
||||
if ctx.message.author.id == superfryta[0]:
|
||||
await ctx.reply("Weszlo")
|
||||
return
|
||||
await ctx.reply("Tylko członkowie Armii Hammera mogą używać. Nie jesteś jednym z nich")
|
||||
else:
|
||||
await ctx.reply("Nope. Nie wiesz jak użyć")
|
||||
#secrets, assistant, echo, dm
|
||||
#required parameter from list of values - assistant, dm_broadcast, echo
|
||||
|
||||
@commands.hybrid_command(
|
||||
name="armia_hammera",
|
||||
description="Jeśli nie wiesz jak użyć tej komendy to nawet nie próbuj",
|
||||
guild=discord.Object(id=664789470779932693),
|
||||
)
|
||||
async def armia_hammera(self, ctx, message_txt: str, recipient: Optional[int]):
|
||||
pass
|
||||
|
||||
async def armia_hammera_back():
|
||||
#user = await self.bot.fetch_user(703985955312238664)
|
||||
#channel = await user.create_dm()
|
||||
#await channel.send(message.content)
|
||||
#await message.reply(f"Poszlo do Saint {message.content}")
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_message(self, message):
|
||||
"""
|
||||
@@ -109,11 +145,9 @@ class Events(commands.Cog):
|
||||
await ai_functions.chat_with_assistant(message, superfryta[1])
|
||||
return
|
||||
channel = self.bot.get_channel(1064888712565100614)
|
||||
#await channel.send("Słyszałem ja żem że: " + message.content)
|
||||
await channel.send("Słyszałem ja żem że: " + message.content)
|
||||
return
|
||||
channel = message.channel
|
||||
# await self.bot.process_commands(message) #uncomment to bilocate
|
||||
|
||||
message.content = message.content.lower()
|
||||
|
||||
tdelta = datetime.now() - MASTER_TIMEOUT
|
||||
|
||||
Reference in New Issue
Block a user