Skip to content

Commit

Permalink
Upgrade python version and add message content intent.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWylie-ZUK committed Jan 4, 2024
1 parent de553e0 commit 198cee8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -36,7 +36,7 @@ jobs:
run: |
pytest --cov --cov-report=html --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.0.0
uses: codecov/codecov-action@v3.1.4
with:
file: out/report/coverage.xml
env_vars: OS,PYTHON
Expand Down
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
runtime: python38
runtime: python312
entrypoint: python -m roll_witch.main
instance_class: F1
automatic_scaling:
Expand Down
6 changes: 5 additions & 1 deletion roll_witch/dice_bot/event_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class EventListenerClient(discord.Client):
def __init__(self):
intents = discord.Intents(messages=True)
intents: discord.Intents = discord.Intents(messages=True, guilds=True, message_content=True )
super().__init__(intents=intents)

async def on_ready(self):
Expand All @@ -19,7 +19,11 @@ async def on_message(self, message):
if message.author == self.user:
return
try:
print(message)
print(f" Channel: {message.channel}")
print(f"Message: {message.content}")
command, roll_string = get_command(message_content=message.content)
print(f"Command {command}")
if command:
response = command.execute(
roll_string=roll_string,
Expand Down

0 comments on commit 198cee8

Please sign in to comment.