Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymcmike committed Apr 19, 2023
2 parents e63b120 + d4456ca commit e6dfee1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions Bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class ChatBot(discord.Client):

def __init__(self, maxlines) -> None:
self.model_name = "355M" # Overwrite with set_model_name()
super().__init__()
intents = discord.Intents.default()
intents.message_content = True
super().__init__(intents=intents)
self.maxlines = maxlines #see comment on main.py line 33

async def on_ready(self) -> None:
Expand Down Expand Up @@ -79,7 +81,7 @@ async def on_message(self, message: discord.Message) -> None:
# Get last n messages, save them to a string to be used as prefix
context = ""
# TODO: make limit parameter # configurable through command line args
history = await message.channel.history(limit=6).flatten()
history = [message async for message in message.channel.history(limit=9)]
history.reverse() # put in right order
for msg in history:
# "context" now becomes a big string containing the content only of the last n messages, line-by-line
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ google-auth-oauthlib==0.4.4
grpcio==1.39.0
huggingface-hub==0.0.12
idna==3.2
joblib==1.0.1
joblib==1.2.0
Markdown==3.3.4
multidict==5.1.0
numpy==1.21.1
numpy==1.22.0
oauthlib==3.1.1
packaging==21.0
Pillow==9.0.0
protobuf==3.17.3
Pillow==9.0.1
protobuf==3.18.3
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.7.0
pyDeprecate==0.3.0
pyparsing==2.4.7
pytorch-lightning==1.3.8
pytorch-lightning==1.6.0
PyYAML==5.4.1
regex==2021.7.6
requests==2.26.0
Expand All @@ -46,11 +46,11 @@ tensorboard-plugin-wit==1.8.0
termcolor==1.1.0
tokenizers==0.10.3
toml==0.10.2
torch==1.9.0
torch==1.13.1
torchmetrics==0.4.1
tqdm==4.61.2
transformers==4.9.0
typing-extensions==3.10.0.0
urllib3==1.26.6
Werkzeug==2.0.1
Werkzeug==2.2.3
yarl==1.6.3

0 comments on commit e6dfee1

Please sign in to comment.