Skip to content

Commit

Permalink
Merge pull request #3 from henriquesebastiao/dev
Browse files Browse the repository at this point in the history
🔧 fix: Removing class scheduling for the second two months and adding…
  • Loading branch information
henriquesebastiao authored Jun 23, 2024
2 parents 1552922 + acf8e34 commit 2027385
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
30 changes: 15 additions & 15 deletions bot/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ async def create_class_events(bot: commands.Bot):
channel_message = guild.get_channel(CHANNEL_MESSAGE_ID)

subjects = [
{
'materia': 'Sistemas Operacionais Und.3',
'date': date(2024, 5, 13),
'description': 'Operação de Sistemas Operacionais.',
},
{
'materia': 'Teoria dos Grafos Und.1',
'date': date(2024, 5, 20),
'description': 'Grafos em árvores, Caminho de Euler, caminho de Hamilton e Algoritmo de percurso.',
},
{
'materia': 'Teoria dos Grafos Und.2',
'date': date(2024, 5, 27),
'description': 'Árvore mínima, Caminhos mínimos, Problema das quatro cores e Fluxos em Grafos.',
},
# {
# 'materia': 'Sistemas Operacionais Und.3',
# 'date': date(2024, 5, 13),
# 'description': 'Operação de Sistemas Operacionais.',
# },
# {
# 'materia': 'Teoria dos Grafos Und.1',
# 'date': date(2024, 5, 20),
# 'description': 'Grafos em árvores, Caminho de Euler, caminho de Hamilton e Algoritmo de percurso.',
# },
# {
# 'materia': 'Teoria dos Grafos Und.2',
# 'date': date(2024, 5, 27),
# 'description': 'Árvore mínima, Caminhos mínimos, Problema das quatro cores e Fluxos em Grafos.',
# },
]

existing_events = guild.scheduled_events
Expand Down
11 changes: 10 additions & 1 deletion bot/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import os
from datetime import datetime
from random import randint
from secrets import randbelow
from typing import Optional

Expand Down Expand Up @@ -64,10 +65,18 @@ async def on_ready():
@bot.event
async def on_member_join(member):
guild = member.guild

greetings = [
'espero que você se divirta!',
'espero que você aprenda muito!',
'espero que possamos te ajudar!',
'sinta-se em casa!',
]

if guild.system_channel is not None:
embed = discord.Embed(
title='Bem vindo ao servidor!',
description=f'Seja bem vindo {member.mention}, espero que você se divirta!',
description=f'Seja bem vindo(a) {member.mention}, {greetings[randint(0, 3)]}',
color=COLOR_YELLOW,
)
await guild.system_channel.send(embed=embed)
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "Unipando"
version = "0.1.0"
version = "0.1.3"
description = "Um bot para Discord para auxiliar estudantes do curso de Ciência da Computação da UNIP."
authors = ["Henrique Sebastião <[email protected]>"]
readme = "README.md"
Expand All @@ -16,11 +16,10 @@ psutil = "^5.9.8"


[tool.poetry.group.dev.dependencies]
taskipy = "^1.12.2"
taskipy = "^1.13.0"
blue = "^0.9.1"
ruff = "^0.4.3"
ruff = "^0.4.10"
isort = "^5.13.2"
bandit = "^1.7.8"
radon = "^6.0.1"

[build-system]
Expand All @@ -43,9 +42,8 @@ ruff = "ruff check ."
blue = "blue --check . --diff"
isort = "isort --check --diff ."
radon = "radon cc ./bot -a -na"
bandit = "bandit -r ./bot"
lint = "task ruff && task blue && task isort"
format = 'blue . && isort .'
ready = "task lint && task radon && task bandit && task export-requirements"
ready = "task lint && task radon && task export-requirements"
export-requirements = "rm requirements.txt && poetry export -f requirements.txt --output requirements.txt --without-hashes --without dev"
run="python ./bot/main.py"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ aiohttp==3.9.5 ; python_version >= "3.12" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.12" and python_version < "4.0"
apscheduler==3.10.4 ; python_version >= "3.12" and python_version < "4.0"
attrs==23.2.0 ; python_version >= "3.12" and python_version < "4.0"
discord-py==2.3.2 ; python_version >= "3.12" and python_version < "4.0"
discord-py==2.4.0 ; python_version >= "3.12" and python_version < "4.0"
discord==2.3.2 ; python_version >= "3.12" and python_version < "4.0"
frozenlist==1.4.1 ; python_version >= "3.12" and python_version < "4.0"
idna==3.7 ; python_version >= "3.12" and python_version < "4.0"
Expand Down

0 comments on commit 2027385

Please sign in to comment.