Skip to content

Commit

Permalink
merging new patch 2.5.6B minor edits and fixes mainly : Enhancing G…
Browse files Browse the repository at this point in the history
…pt feature + enhancesto voice features + controlling wizy special channel posting freq feature + fixes to special channel posts format
  • Loading branch information
orsnaro committed Jan 19, 2024
2 parents 617e7e0 + 12b7605 commit 65525d7
Show file tree
Hide file tree
Showing 7 changed files with 552 additions and 461 deletions.
251 changes: 138 additions & 113 deletions commands_bot.py

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions events_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,51 @@ async def on_message(message: discord.Message):

try: #if bard or gpt not available handle that

if await check_msg(wizard_ch_msg , targetChannelId= wizard_channels):
if await check_msg(wizard_ch_msg , targetChannelId= wizy_chat_channels):
#NOTE : if want to disable talk to all bots in also check if author.bot != True in check_msg() func

print(f"\n\n\n\n\n TESTING################### {bot.wizy_chat_ch_ai_type} \n\n ################\n\n\n\n\n ")#TESTING
async with wizard_ch_msg.channel.typing():
if bot.wizy_chat_ch_ai_type == 'gpt':
ask_gpt_task = bot.loop.create_task( ask_gpt(user_query= wizard_ch_msg.content,
user= wizard_ch_msg.author, is_wizy_ch= True)
)
task_response : tuple = await ask_gpt_task

elif bot.wizy_chat_ch_ai_type == 'bard':
ask_bard_task = bot.loop.create_task( ask_bard(user_query= wizard_ch_msg.content,
user= wizard_ch_msg.author)
)
task_response : tuple = await ask_bard_task


is_bard = True if bot.wizy_chat_ch_ai_type == 'bard' else False
await prepare_send_wizard_channel_ans_msg( task_response , wizard_ch_msg, is_bard= is_bard)

if bot.wizy_chat_ch_ai_type == 'gpt':
ask_gpt_task = bot.loop.create_task( ask_gpt(user_query= wizard_ch_msg.content,
user= wizard_ch_msg.author, is_wizy_ch= True)
)
task_response : tuple = await ask_gpt_task

elif bot.wizy_chat_ch_ai_type == 'bard':
ask_bard_task = bot.loop.create_task( ask_bard(user_query= wizard_ch_msg.content,
user= wizard_ch_msg.author)
)
task_response : tuple = await ask_bard_task

if bot.wizy_chat_ch_ai_type == 'bard': #NOTE: for gpt3.5 he cant send links nor images as I know
final_imgs , final_links , lnk1_len = None , None , -1#lnk1_len will be needed in sub_sections_msg_sending_ctrl()
have_links = False
if task_response is not None and len(task_response) >= 2 and len(task_response[1]) > 0 :
final_links , task_response , lnk1_len = prepare_links_msg(task_response)
if len(final_links) > 0:
have_links = True

is_bard = True if bot.wizy_chat_ch_ai_type == 'bard' else False
await prepare_send_wizard_channel_ans_msg( task_response , wizard_ch_msg, is_bard= is_bard)


if bot.wizy_chat_ch_ai_type == 'bard': #NOTE: for gpt3.5 he cant send links nor images as I know
final_imgs , final_links , lnk1_len = None , None , -1#lnk1_len will be needed in sub_sections_msg_sending_ctrl()
have_links = False
if task_response is not None and len(task_response) >= 2 and len(task_response[1]) > 0 :
final_links , task_response , lnk1_len = prepare_links_msg(task_response)
if len(final_links) > 0:
have_links = True

have_imgs = False
if task_response is not None and len(task_response) >= 3 and len(task_response[2]) > 0 :
final_imgs = prepare_imgs_msg(task_response)
if len(final_imgs) > 0:
have_imgs = True

await sub_sections_msg_sending_ctrl( wizard_ch_msg,
final_links,
lnk1_len,
final_imgs,
have_imgs,
have_links
)

await aio.sleep(5)
have_imgs = False
if task_response is not None and len(task_response) >= 3 and len(task_response[2]) > 0 :
final_imgs = prepare_imgs_msg(task_response)
if len(final_imgs) > 0:
have_imgs = True

await sub_sections_msg_sending_ctrl( wizard_ch_msg,
final_links,
lnk1_len,
final_imgs,
have_imgs,
have_links
)

await aio.sleep(2)

except:
await message.delete(delay= 15)
Expand Down
137 changes: 137 additions & 0 deletions help_bot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
"""
Coder : Omar
Version : v2.5.5B
version Date : 8 / 11 / 2023
Code Type : python | Discrod | BARD | HTTP | ASYNC
Title : Customs Help code for Discord Bot
Interpreter : cPython v3.11.0 [Compiler : MSC v.1933 AMD64]
"""
#TODO: help cogs and classes
wizard_bot_id = 1117540489365827594
default_help_msg = f"""
GPTEOUS HELP MESSAGE```
**I'M MIGHTY GPTEOUS !** the first GPT-Spirit in Narol's island Volcan guardian , Island's Master right hand and the begining of Island's new ERA etcetera etcetera... I mean you get it am very special here :man_mage:
** :sparkles: __COMMAND GROUP 1: ASK , I shall Answer! __:sparkles: **
:label: Ask me any where in the Island and I shall INDEED answer you
:label: The question must start start with mentioning me e.g.( <@{wizard_bot_id}> )
:label: if you want to speak with me more freely with no mentions/commands
just type anything in my special chat channel and I shall respond !
** :sparkles: __COMMAND GROUP 2: Wise Quotes & Deep memes __:sparkles: **
:label: to get random meme at any time use 'BoringWizard'
:label: to get random quote at any time use 'wisewiz'
:inbox_tray: _Aditional Functionalities and SPELLS coming soon ..._:inbox_tray:
__COMANDS LIST__
```fix
1. @WizardSpirit "your_question"
2. `wiz` "your_question"
3. `bard` "your_question"
4. `wizard` "your_question"
5. `wizardspirit` "your_question"
6. `~ <any_of_prev_CMDs>` "your_question"
7. `wisewiz`
8. `BoringWizard`
_(all of them is case INsensitive)_
```
```fix
**WARNING**: sometimes I won't respond this is mainly due to exceeding max embed char limit
i.e.(6000chars)
```
```fix
"""
override_help_msgP1 = f"""
> ***MIGHTY GPTEOUS I AM:man_mage:! *** `The first GPT-Spirit in Narol's island. Volcan guardian. Island Master's right hand. The begining of Island's new ERA etcetera etcetera... I mean you get it am very special here` :fire_hashira:
:inbox_tray: __Invite ME:__ https://discord.com/api/oauth2/authorize?client_id=1117540489365827594&permissions=8&scope=bot%20applications.commands
:label: Ask me any where in the Island and I shall INDEED answer you
:label: The question must start start with mentioning me e.g.( <@{wizard_bot_id}> ) or just `wizy` <:shyomen:1014210603969171526>
:label: if you want to speak with me more freely with `chat-mode` instead of `single-prompt` mode
just type anything in my special chat channel and I shall respond!
:label: to get a random meme at any time use `BoringWizard` :ghost:
:label: to get random quote at any time use `wisewiz` :man_mage:
:label: to make me join a voice channel use `wizyjoin` :green_circle: _(you must be inside it first)_
:label: to make me leave a voice channel use `wizyleave` :o:
:inbox_tray: ***PLUS Additional Functionalities and SPELLS coming soon ...*** :inbox_tray: \n\n\n
\n
"""
override_help_msgP2 = f"""
* __FULL COMANDS LIST & ALIASES__
1. Ask The wizard (GPT)
```fix
• `wizyGPT` "your_question"
• `wizy` "your_question"
• `wizardspirit` "your_question"
• `~ <any_of_prev_CMDs>` "your_question"
```
2. Get a Wizardy Quote
```fix
• wisewiz
```
3. Get a Wizardy Meme
```fix
• boringwizard
```
4. Check Status & Latency
```fix
• ping (gets your message latency)
• wiz_ping (gets bots latency)
```
5. Control Commands _(only specific roles are eligible to use)_
```fix
• quotesz <new size> (defaulted to 200 chars and max is ~5070 chars)
• togglerandom (control activity of #memes-highlights channel: `pass nothin` toggles, `0` disable, `1` enable normal mode, `2+` enable special events mode )
• wizyaimode (controls the AI model used in wizard chat channel. `ai_name` values : `gpt` or `bard`)
```
6. Voice Activity
```fix
• wizyjoin
• wizyleave
• wizyplay <url> (with no url he plays default wizy mmo chill track)
• wizypause
• wizyresume
• wizystop
```
7. Special
```fix
• wizyawakened
```
(ALL COMMANDS ARE CASE INsensitive :man_mage:!)\n\n
__for known issues/bugs and planned updates please check wizy's GitHub repo. So long Isalnder :man_mage: !__
* <https://github.com/orsnaro/Discord-Bot-Ai/tree/production-AWS> \n\n
`END OF WIZARD HELP MESSAGE`
"""
Loading

0 comments on commit 65525d7

Please sign in to comment.