Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Reminders for Live Sessions from Subject Calendars #32

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
998870b
Updated setup docs
kry0sc0pic Jun 18, 2023
e71c4a1
typo fix
kry0sc0pic Jun 18, 2023
5801acf
fixed server link formatting
kry0sc0pic Jun 18, 2023
dddf389
typo 2
kry0sc0pic Jun 18, 2023
e9ea636
Updated server invite link
sinsniwal Jul 6, 2023
791b31b
Ping Message Embed and scheduler v1 (untested)
kry0sc0pic Jul 19, 2023
363cc68
Merge branch 'main' of https://github.com/kry0sc0pic/iitm-server-bot
kry0sc0pic Jul 19, 2023
923209c
Merge branch 'sinsniwal:main' into main
kry0sc0pic Jul 19, 2023
9ebeabb
rebuilt notification system
kry0sc0pic Jul 20, 2023
4d2176f
WIP Event Retrieval
kry0sc0pic Jul 21, 2023
9abed78
event retrieval is working :)
kry0sc0pic Jul 21, 2023
7dcf862
added code for multi calendar support
kry0sc0pic Jul 21, 2023
1179e06
Added Calendars and Tutorial Link
kry0sc0pic Jul 21, 2023
01d5d09
Added ID Check for debug command
kry0sc0pic Jul 21, 2023
411c440
Updated dependencies and added dockerfile
kry0sc0pic Jul 21, 2023
4173641
Fixed typo
kry0sc0pic Jul 21, 2023
9e8a0b4
indentation error fix
kry0sc0pic Jul 21, 2023
ff1608b
python being weird for no reason
kry0sc0pic Jul 21, 2023
938ff11
improved upcoming
kry0sc0pic Jul 21, 2023
88b4e44
removed my counter
kry0sc0pic Jul 21, 2023
08cf09b
more details woooo
kry0sc0pic Jul 21, 2023
8b03fed
temporary timezone fix
kry0sc0pic Jul 21, 2023
c162cf9
bugfix for edge case
kry0sc0pic Jul 21, 2023
a1ce679
found the actual timestamp bug
kry0sc0pic Jul 22, 2023
8063b6d
code should match style guidelines now
kry0sc0pic Jul 22, 2023
c959d46
rewrite live ping
lmaotrigine Jul 22, 2023
1216927
apparently, it is not fine
lmaotrigine Jul 22, 2023
2689a45
pain and woe and misery
lmaotrigine Jul 22, 2023
b49cca2
thanks yarl
lmaotrigine Jul 22, 2023
bef4285
google issa sux
lmaotrigine Jul 22, 2023
c4af86b
inequalities are hard :(
lmaotrigine Jul 22, 2023
a93edab
am i a stupid
lmaotrigine Jul 22, 2023
99392ab
extract meeting IDs from API response
lmaotrigine Jul 22, 2023
c433071
Merge pull request #1 from lmaotrigine/live-session-pings
kry0sc0pic Jul 22, 2023
7aca70d
Added Icons, Regex Fallback and Better Testing Cmd
kry0sc0pic Jul 23, 2023
97781d0
added dockerfile for rpi as well
kry0sc0pic Jul 23, 2023
88cbf8e
adedd the chunky dockerfile
kry0sc0pic Jul 23, 2023
8730fd5
Fixed reminder time
kry0sc0pic Jul 23, 2023
7b21eb0
Improved Embed Look
kry0sc0pic Jul 23, 2023
3346e43
Remove extra dockerfiles
kry0sc0pic Jul 23, 2023
fd754f3
fix bot prefix
kry0sc0pic Jul 25, 2023
0a59f40
buff code readability
kry0sc0pic Jul 25, 2023
7ab2968
divorce shitty pagination library
lmaotrigine Jul 25, 2023
4af6867
fix wrong types
lmaotrigine Jul 25, 2023
e05e726
added type hint for icon_url
kry0sc0pic Jul 25, 2023
0123af1
remove unecessary regex
kry0sc0pic Jul 25, 2023
95fa749
rename command and add role gate
kry0sc0pic Jul 26, 2023
998191b
[UNTESTED] Used discord-ext-menus for pagination
kry0sc0pic Jul 26, 2023
d0abf18
added environment variable to .env
kry0sc0pic Jul 26, 2023
a60e195
added missing import
kry0sc0pic Jul 26, 2023
e1ab1f3
Merge branch 'live-session-pings' into pagination
kry0sc0pic Jul 28, 2023
de17552
Merge pull request #2 from lmaotrigine/pagination
kry0sc0pic Jul 28, 2023
c8b6b76
ran precommit formatting
kry0sc0pic Jul 30, 2023
9e3bae2
removed unused class
kry0sc0pic Jul 30, 2023
04c543e
better dockerignore
lmaotrigine Jul 31, 2023
335bd7f
Merge pull request #3 from lmaotrigine/live-session-pings
kry0sc0pic Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
venv/
__pycache__
kry0sc0pic marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.11-alpine
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "main.py"]
14 changes: 12 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from logging.handlers import TimedRotatingFileHandler
from traceback import TracebackException

import aiohttp
import discord
from discord import app_commands
from discord.ext import commands
Expand Down Expand Up @@ -93,9 +94,10 @@ class IITMBot(commands.AutoShardedBot):
"""

user: discord.ClientUser
session: aiohttp.ClientSession

@classmethod
def _use_default(cls):
def _use_default(cls, *, session: aiohttp.ClientSession):
"""
Create an instance of IITMBot with base configuration
"""
Expand All @@ -111,6 +113,7 @@ def _use_default(cls):
help_command=None,
tree_cls=BotTree,
)
x.session = session
return x

async def load_extensions(self):
Expand All @@ -121,10 +124,17 @@ async def load_extensions(self):
await self.load_extension(f"cogs.{filename[:-3]}")
logger.info(f"Loaded cogs.{filename[:-3]}")
except Exception as e:
logger.error(f"cogs.{filename[:-3]} failed to load: {e}")
logger.exception(f"cogs.{filename[:-3]} failed to load: {e}", exc_info=e)

async def setup_hook(self) -> None:
await self.load_extensions()

async def on_ready(self):
logger.info("Logged in as")
logger.info(f"\tUser: {self.user.name}")
logger.info(f"\tID : {self.user.id}")
logger.info("------")

async def close(self) -> None:
await super().close()
await self.session.close()
Loading