From ead5a52c2b9f56b836757e5ad00545d62e418ea3 Mon Sep 17 00:00:00 2001 From: nuttysunday Date: Wed, 18 Oct 2023 14:13:28 -0400 Subject: [PATCH 1/2] Added files to .gitignore --- json/credentials.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/json/credentials.json b/json/credentials.json index 07698b6..99e8265 100644 --- a/json/credentials.json +++ b/json/credentials.json @@ -1,7 +1,7 @@ -{"installed":{"client_id":"30638459199-kd4ckckv126qbp9tkf6gp05qt7ip0g9g.apps.googleusercontent.com", - "project_id":"schedulebot-333520", +{"installed":{"client_id":"105595985804-vluubc0fcn23thkeahtd04r3esqg462b.apps.googleusercontent.com", + "project_id":"schedulebot-399221", "auth_uri":"https://accounts.google.com/o/oauth2/auth", "token_uri":"https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", - "client_secret":"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", + "client_secret":"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", "redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}} \ No newline at end of file From e947c34b3ebe60bc25d93a5b5d4cf7f306bc44c7 Mon Sep 17 00:00:00 2001 From: nuttysunday Date: Wed, 18 Oct 2023 18:41:58 -0400 Subject: [PATCH 2/2] added remind issue funcitonality, but a bug in threading which needs to ve solved --- .gitignore | 2 +- discord_bot/bin/Activate.ps1 | 241 ++++++++++++++++ discord_bot/bin/activate | 66 +++++ discord_bot/bin/activate.csh | 25 ++ discord_bot/bin/activate.fish | 64 +++++ discord_bot/bin/coverage | 8 + discord_bot/bin/coverage-3.9 | 8 + discord_bot/bin/coverage-badge | 8 + discord_bot/bin/coverage3 | 8 + discord_bot/bin/emoji | 8 + discord_bot/bin/f2py | 8 + discord_bot/bin/google-oauthlib-tool | 8 + discord_bot/bin/icalendar | 8 + discord_bot/bin/ipython | 8 + discord_bot/bin/ipython3 | 8 + discord_bot/bin/jupyter | 8 + discord_bot/bin/jupyter-kernel | 8 + discord_bot/bin/jupyter-kernelspec | 8 + discord_bot/bin/jupyter-migrate | 8 + discord_bot/bin/jupyter-run | 8 + discord_bot/bin/jupyter-troubleshoot | 8 + discord_bot/bin/mako-render | 8 + discord_bot/bin/markdown_py | 8 + discord_bot/bin/normalizer | 8 + discord_bot/bin/pdoc | 8 + discord_bot/bin/pdoc3 | 8 + discord_bot/bin/pip | 8 + discord_bot/bin/pip3 | 8 + discord_bot/bin/pip3.9 | 8 + discord_bot/bin/py.test | 8 + discord_bot/bin/pygmentize | 8 + discord_bot/bin/pyrsa-decrypt | 8 + discord_bot/bin/pyrsa-encrypt | 8 + discord_bot/bin/pyrsa-keygen | 8 + discord_bot/bin/pyrsa-priv2pub | 8 + discord_bot/bin/pyrsa-sign | 8 + discord_bot/bin/pyrsa-verify | 8 + discord_bot/bin/pytest | 8 + discord_bot/bin/python | 1 + discord_bot/bin/python3 | 1 + discord_bot/bin/python3.9 | 1 + discord_bot/bin/test | 8 + discord_bot/pyvenv.cfg | 3 + .../share/jupyter/kernels/python3/kernel.json | 14 + .../jupyter/kernels/python3/logo-32x32.png | Bin 0 -> 1084 bytes .../jupyter/kernels/python3/logo-64x64.png | Bin 0 -> 2180 bytes .../jupyter/kernels/python3/logo-svg.svg | 265 ++++++++++++++++++ discord_bot/share/man/man1/ipython.1 | 60 ++++ docs/schedulebot.html | 3 + src/functionality/highlights.py | 41 +++ src/functionality/test.ipynb | 64 +++++ src/remind_event.py | 22 ++ src/schedulebot.py | 12 +- src/test.ipynb | 264 +++++++++++++++++ 54 files changed, 1417 insertions(+), 4 deletions(-) create mode 100644 discord_bot/bin/Activate.ps1 create mode 100644 discord_bot/bin/activate create mode 100644 discord_bot/bin/activate.csh create mode 100644 discord_bot/bin/activate.fish create mode 100755 discord_bot/bin/coverage create mode 100755 discord_bot/bin/coverage-3.9 create mode 100755 discord_bot/bin/coverage-badge create mode 100755 discord_bot/bin/coverage3 create mode 100755 discord_bot/bin/emoji create mode 100755 discord_bot/bin/f2py create mode 100755 discord_bot/bin/google-oauthlib-tool create mode 100755 discord_bot/bin/icalendar create mode 100755 discord_bot/bin/ipython create mode 100755 discord_bot/bin/ipython3 create mode 100755 discord_bot/bin/jupyter create mode 100755 discord_bot/bin/jupyter-kernel create mode 100755 discord_bot/bin/jupyter-kernelspec create mode 100755 discord_bot/bin/jupyter-migrate create mode 100755 discord_bot/bin/jupyter-run create mode 100755 discord_bot/bin/jupyter-troubleshoot create mode 100755 discord_bot/bin/mako-render create mode 100755 discord_bot/bin/markdown_py create mode 100755 discord_bot/bin/normalizer create mode 100755 discord_bot/bin/pdoc create mode 100755 discord_bot/bin/pdoc3 create mode 100755 discord_bot/bin/pip create mode 100755 discord_bot/bin/pip3 create mode 100755 discord_bot/bin/pip3.9 create mode 100755 discord_bot/bin/py.test create mode 100755 discord_bot/bin/pygmentize create mode 100755 discord_bot/bin/pyrsa-decrypt create mode 100755 discord_bot/bin/pyrsa-encrypt create mode 100755 discord_bot/bin/pyrsa-keygen create mode 100755 discord_bot/bin/pyrsa-priv2pub create mode 100755 discord_bot/bin/pyrsa-sign create mode 100755 discord_bot/bin/pyrsa-verify create mode 100755 discord_bot/bin/pytest create mode 120000 discord_bot/bin/python create mode 120000 discord_bot/bin/python3 create mode 120000 discord_bot/bin/python3.9 create mode 100755 discord_bot/bin/test create mode 100644 discord_bot/pyvenv.cfg create mode 100644 discord_bot/share/jupyter/kernels/python3/kernel.json create mode 100644 discord_bot/share/jupyter/kernels/python3/logo-32x32.png create mode 100644 discord_bot/share/jupyter/kernels/python3/logo-64x64.png create mode 100644 discord_bot/share/jupyter/kernels/python3/logo-svg.svg create mode 100644 discord_bot/share/man/man1/ipython.1 create mode 100644 src/functionality/test.ipynb create mode 100644 src/remind_event.py create mode 100644 src/test.ipynb diff --git a/.gitignore b/.gitignore index a5d1129..187da17 100644 --- a/.gitignore +++ b/.gitignore @@ -106,7 +106,7 @@ celerybeat.pid user_data.json token.json key.json - +credentials.json # Environments .env .venv diff --git a/discord_bot/bin/Activate.ps1 b/discord_bot/bin/Activate.ps1 new file mode 100644 index 0000000..2fb3852 --- /dev/null +++ b/discord_bot/bin/Activate.ps1 @@ -0,0 +1,241 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/discord_bot/bin/activate b/discord_bot/bin/activate new file mode 100644 index 0000000..6639666 --- /dev/null +++ b/discord_bot/bin/activate @@ -0,0 +1,66 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null + fi + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1="(discord_bot) ${PS1:-}" + export PS1 +fi + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null +fi diff --git a/discord_bot/bin/activate.csh b/discord_bot/bin/activate.csh new file mode 100644 index 0000000..db2456d --- /dev/null +++ b/discord_bot/bin/activate.csh @@ -0,0 +1,25 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = "(discord_bot) $prompt" +endif + +alias pydoc python -m pydoc + +rehash diff --git a/discord_bot/bin/activate.fish b/discord_bot/bin/activate.fish new file mode 100644 index 0000000..676b59c --- /dev/null +++ b/discord_bot/bin/activate.fish @@ -0,0 +1,64 @@ +# This file must be used with "source /bin/activate.fish" *from fish* +# (https://fishshell.com/); you cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + functions -e fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + + set -e VIRTUAL_ENV + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV "/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) "(discord_bot) " (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/discord_bot/bin/coverage b/discord_bot/bin/coverage new file mode 100755 index 0000000..744e369 --- /dev/null +++ b/discord_bot/bin/coverage @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from coverage.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/coverage-3.9 b/discord_bot/bin/coverage-3.9 new file mode 100755 index 0000000..744e369 --- /dev/null +++ b/discord_bot/bin/coverage-3.9 @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from coverage.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/coverage-badge b/discord_bot/bin/coverage-badge new file mode 100755 index 0000000..ad140e3 --- /dev/null +++ b/discord_bot/bin/coverage-badge @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from coverage_badge.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/coverage3 b/discord_bot/bin/coverage3 new file mode 100755 index 0000000..744e369 --- /dev/null +++ b/discord_bot/bin/coverage3 @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from coverage.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/emoji b/discord_bot/bin/emoji new file mode 100755 index 0000000..c0e189c --- /dev/null +++ b/discord_bot/bin/emoji @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tests.test_pretty_help import run_emoji +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_emoji()) diff --git a/discord_bot/bin/f2py b/discord_bot/bin/f2py new file mode 100755 index 0000000..69e84ed --- /dev/null +++ b/discord_bot/bin/f2py @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/google-oauthlib-tool b/discord_bot/bin/google-oauthlib-tool new file mode 100755 index 0000000..08e6b7e --- /dev/null +++ b/discord_bot/bin/google-oauthlib-tool @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from google_auth_oauthlib.tool.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/icalendar b/discord_bot/bin/icalendar new file mode 100755 index 0000000..328523a --- /dev/null +++ b/discord_bot/bin/icalendar @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from icalendar.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/ipython b/discord_bot/bin/ipython new file mode 100755 index 0000000..69f51e8 --- /dev/null +++ b/discord_bot/bin/ipython @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from IPython import start_ipython +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(start_ipython()) diff --git a/discord_bot/bin/ipython3 b/discord_bot/bin/ipython3 new file mode 100755 index 0000000..69f51e8 --- /dev/null +++ b/discord_bot/bin/ipython3 @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from IPython import start_ipython +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(start_ipython()) diff --git a/discord_bot/bin/jupyter b/discord_bot/bin/jupyter new file mode 100755 index 0000000..27ddb00 --- /dev/null +++ b/discord_bot/bin/jupyter @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jupyter_core.command import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/jupyter-kernel b/discord_bot/bin/jupyter-kernel new file mode 100755 index 0000000..953bfa8 --- /dev/null +++ b/discord_bot/bin/jupyter-kernel @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jupyter_client.kernelapp import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/jupyter-kernelspec b/discord_bot/bin/jupyter-kernelspec new file mode 100755 index 0000000..e45da95 --- /dev/null +++ b/discord_bot/bin/jupyter-kernelspec @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jupyter_client.kernelspecapp import KernelSpecApp +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(KernelSpecApp.launch_instance()) diff --git a/discord_bot/bin/jupyter-migrate b/discord_bot/bin/jupyter-migrate new file mode 100755 index 0000000..834237e --- /dev/null +++ b/discord_bot/bin/jupyter-migrate @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jupyter_core.migrate import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/jupyter-run b/discord_bot/bin/jupyter-run new file mode 100755 index 0000000..8b71dda --- /dev/null +++ b/discord_bot/bin/jupyter-run @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jupyter_client.runapp import RunApp +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(RunApp.launch_instance()) diff --git a/discord_bot/bin/jupyter-troubleshoot b/discord_bot/bin/jupyter-troubleshoot new file mode 100755 index 0000000..b6f1e16 --- /dev/null +++ b/discord_bot/bin/jupyter-troubleshoot @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from jupyter_core.troubleshoot import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/mako-render b/discord_bot/bin/mako-render new file mode 100755 index 0000000..db636ca --- /dev/null +++ b/discord_bot/bin/mako-render @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from mako.cmd import cmdline +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cmdline()) diff --git a/discord_bot/bin/markdown_py b/discord_bot/bin/markdown_py new file mode 100755 index 0000000..f978bd7 --- /dev/null +++ b/discord_bot/bin/markdown_py @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from markdown.__main__ import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/discord_bot/bin/normalizer b/discord_bot/bin/normalizer new file mode 100755 index 0000000..903842e --- /dev/null +++ b/discord_bot/bin/normalizer @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from charset_normalizer.cli import cli_detect +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli_detect()) diff --git a/discord_bot/bin/pdoc b/discord_bot/bin/pdoc new file mode 100755 index 0000000..53c419c --- /dev/null +++ b/discord_bot/bin/pdoc @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pdoc.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/pdoc3 b/discord_bot/bin/pdoc3 new file mode 100755 index 0000000..53c419c --- /dev/null +++ b/discord_bot/bin/pdoc3 @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pdoc.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/pip b/discord_bot/bin/pip new file mode 100755 index 0000000..1e28ca3 --- /dev/null +++ b/discord_bot/bin/pip @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/pip3 b/discord_bot/bin/pip3 new file mode 100755 index 0000000..1e28ca3 --- /dev/null +++ b/discord_bot/bin/pip3 @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/pip3.9 b/discord_bot/bin/pip3.9 new file mode 100755 index 0000000..1e28ca3 --- /dev/null +++ b/discord_bot/bin/pip3.9 @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/py.test b/discord_bot/bin/py.test new file mode 100755 index 0000000..4ea8e2f --- /dev/null +++ b/discord_bot/bin/py.test @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pytest import console_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(console_main()) diff --git a/discord_bot/bin/pygmentize b/discord_bot/bin/pygmentize new file mode 100755 index 0000000..efecb45 --- /dev/null +++ b/discord_bot/bin/pygmentize @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/discord_bot/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pygments.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/discord_bot/bin/pyrsa-decrypt b/discord_bot/bin/pyrsa-decrypt new file mode 100755 index 0000000..1bca95f --- /dev/null +++ b/discord_bot/bin/pyrsa-decrypt @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import decrypt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(decrypt()) diff --git a/discord_bot/bin/pyrsa-encrypt b/discord_bot/bin/pyrsa-encrypt new file mode 100755 index 0000000..ea219d6 --- /dev/null +++ b/discord_bot/bin/pyrsa-encrypt @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import encrypt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(encrypt()) diff --git a/discord_bot/bin/pyrsa-keygen b/discord_bot/bin/pyrsa-keygen new file mode 100755 index 0000000..7048400 --- /dev/null +++ b/discord_bot/bin/pyrsa-keygen @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import keygen +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(keygen()) diff --git a/discord_bot/bin/pyrsa-priv2pub b/discord_bot/bin/pyrsa-priv2pub new file mode 100755 index 0000000..72037fc --- /dev/null +++ b/discord_bot/bin/pyrsa-priv2pub @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from rsa.util import private_to_public +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(private_to_public()) diff --git a/discord_bot/bin/pyrsa-sign b/discord_bot/bin/pyrsa-sign new file mode 100755 index 0000000..1bd2848 --- /dev/null +++ b/discord_bot/bin/pyrsa-sign @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import sign +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(sign()) diff --git a/discord_bot/bin/pyrsa-verify b/discord_bot/bin/pyrsa-verify new file mode 100755 index 0000000..d162a99 --- /dev/null +++ b/discord_bot/bin/pyrsa-verify @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import verify +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(verify()) diff --git a/discord_bot/bin/pytest b/discord_bot/bin/pytest new file mode 100755 index 0000000..4ea8e2f --- /dev/null +++ b/discord_bot/bin/pytest @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pytest import console_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(console_main()) diff --git a/discord_bot/bin/python b/discord_bot/bin/python new file mode 120000 index 0000000..b8a0adb --- /dev/null +++ b/discord_bot/bin/python @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/discord_bot/bin/python3 b/discord_bot/bin/python3 new file mode 120000 index 0000000..f25545f --- /dev/null +++ b/discord_bot/bin/python3 @@ -0,0 +1 @@ +/Library/Developer/CommandLineTools/usr/bin/python3 \ No newline at end of file diff --git a/discord_bot/bin/python3.9 b/discord_bot/bin/python3.9 new file mode 120000 index 0000000..b8a0adb --- /dev/null +++ b/discord_bot/bin/python3.9 @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/discord_bot/bin/test b/discord_bot/bin/test new file mode 100755 index 0000000..ecb4970 --- /dev/null +++ b/discord_bot/bin/test @@ -0,0 +1,8 @@ +#!/Users/sunday/brainfuck/schedule_bot/ScheduleBot/discord_bot/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tests.test_pretty_help import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/discord_bot/pyvenv.cfg b/discord_bot/pyvenv.cfg new file mode 100644 index 0000000..4760c1f --- /dev/null +++ b/discord_bot/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /Library/Developer/CommandLineTools/usr/bin +include-system-site-packages = false +version = 3.9.6 diff --git a/discord_bot/share/jupyter/kernels/python3/kernel.json b/discord_bot/share/jupyter/kernels/python3/kernel.json new file mode 100644 index 0000000..cca38a4 --- /dev/null +++ b/discord_bot/share/jupyter/kernels/python3/kernel.json @@ -0,0 +1,14 @@ +{ + "argv": [ + "python", + "-m", + "ipykernel_launcher", + "-f", + "{connection_file}" + ], + "display_name": "Python 3 (ipykernel)", + "language": "python", + "metadata": { + "debugger": true + } +} \ No newline at end of file diff --git a/discord_bot/share/jupyter/kernels/python3/logo-32x32.png b/discord_bot/share/jupyter/kernels/python3/logo-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..be81330765764699553aa4fbaf0e9fc27c20c6d2 GIT binary patch literal 1084 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 + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/discord_bot/share/man/man1/ipython.1 b/discord_bot/share/man/man1/ipython.1 new file mode 100644 index 0000000..0f4a191 --- /dev/null +++ b/discord_bot/share/man/man1/ipython.1 @@ -0,0 +1,60 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH IPYTHON 1 "July 15, 2011" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) and groff_man(7) +.\" .SH section heading +.\" .SS secondary section heading +.\" +.\" +.\" To preview this page as plain text: nroff -man ipython.1 +.\" +.SH NAME +ipython \- Tools for Interactive Computing in Python. +.SH SYNOPSIS +.B ipython +.RI [ options ] " files" ... + +.B ipython subcommand +.RI [ options ] ... + +.SH DESCRIPTION +An interactive Python shell with automatic history (input and output), dynamic +object introspection, easier configuration, command completion, access to the +system shell, integration with numerical and scientific computing tools, +web notebook, Qt console, and more. + +For more information on how to use IPython, see 'ipython \-\-help', +or 'ipython \-\-help\-all' for all available command\(hyline options. + +.SH "ENVIRONMENT VARIABLES" +.sp +.PP +\fIIPYTHONDIR\fR +.RS 4 +This is the location where IPython stores all its configuration files. The default +is $HOME/.ipython if IPYTHONDIR is not defined. + +You can see the computed value of IPYTHONDIR with `ipython locate`. + +.SH FILES + +IPython uses various configuration files stored in profiles within IPYTHONDIR. +To generate the default configuration files and start configuring IPython, +do 'ipython profile create', and edit '*_config.py' files located in +IPYTHONDIR/profile_default. + +.SH AUTHORS +IPython is written by the IPython Development Team . diff --git a/docs/schedulebot.html b/docs/schedulebot.html index b730fd5..69227c4 100644 --- a/docs/schedulebot.html +++ b/docs/schedulebot.html @@ -251,6 +251,9 @@

Module src.schedulebot

""" await get_free_time(ctx, bot) +async def remind_event(ctx, arg): + await remind_event(ctx, arg) + # Runs the bot (local machine) if __name__ == "__main__": diff --git a/src/functionality/highlights.py b/src/functionality/highlights.py index e44d348..2d6880a 100644 --- a/src/functionality/highlights.py +++ b/src/functionality/highlights.py @@ -36,6 +36,7 @@ async def get_highlight(ctx, arg): # For every row in calendar file for row in rows[1:]: # Get event details + print(row) event['name'] = row[1] start = row[2].split() event['startDate'] = start[0] @@ -170,3 +171,43 @@ def convert_to_12(time): return new_time # test() + +async def get_event_list(ctx, arg): + """ + Function: + get_highlight + Description: + Shows the events planned for the day by the user. + Input: + - ctx - Discord context window + - arg - The input arguments which specify the date + Output: + - A message sent to the context with all the events that start and/or end today + """ + # Get the date + day = get_date(arg) + + # Open and read user's calendar file + create_event_tree(str(ctx.id)) + rows = read_event_file(str(ctx.id)) + + # Initialize variables + event = {'name': '', 'startDate': '', 'startTime': '', 'endDate': '', 'endTime': '', 'type': '', 'desc': '','loc': ''} + events = [] + + # If there are events in the file + if len(rows) > 1: + # For every row in calendar file + for row in rows[1:]: + # Get event details + #print(row) + event['name'] = row[1] + event['startDateTime'] = row[2] + event['endDateTime'] = row[3] + event['type'] = row[4] + event['desc'] = row[5] + event['location'] = row[6] + events.append(event) + + return events + \ No newline at end of file diff --git a/src/functionality/test.ipynb b/src/functionality/test.ipynb new file mode 100644 index 0000000..da98534 --- /dev/null +++ b/src/functionality/test.ipynb @@ -0,0 +1,64 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/src/functionality/test.ipynb Cell 5\u001b[0m line \u001b[0;36m1\n\u001b[1;32m 15\u001b[0m \u001b[39mif\u001b[39;00m (datetime_object\u001b[39m.\u001b[39mminute \u001b[39m-\u001b[39m event_test\u001b[39m.\u001b[39mminute) \u001b[39m<\u001b[39m\u001b[39m=\u001b[39m \u001b[39m10\u001b[39m:\n\u001b[1;32m 16\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m\"\u001b[39m\u001b[39mBrain not fuck\u001b[39m\u001b[39m\"\u001b[39m) \n\u001b[0;32m---> 18\u001b[0m time\u001b[39m.\u001b[39;49msleep(\u001b[39m300\u001b[39;49m) \u001b[39m# Fetch the time every 5 mins\u001b[39;00m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "import time\n", + "import datetime\n", + "\n", + "while True:\n", + " current_time = time.strftime(\"%Y-%m-%d %H:%M\")\n", + " #print(\"Current Time:\", current_time)\n", + " datetime_object = datetime.datetime.strptime(current_time, \"%Y-%m-%d %H:%M\")\n", + "\n", + " event_time = datetime.time(15, 50, 00)\n", + " event_date = datetime.date(2023, 10, 18)\n", + " event_test = datetime.datetime.combine(event_date, event_time)\n", + " \n", + " if datetime_object.date() == event_test.date():\n", + " if datetime_object.hour == event_test.hour:\n", + " if (datetime_object.minute - event_test.minute) <= 10:\n", + " print(\"Brain not fuck\") \n", + " \n", + " time.sleep(300) # Fetch the time every 5 mins\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "discord_bot", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/src/remind_event.py b/src/remind_event.py new file mode 100644 index 0000000..cc8edf5 --- /dev/null +++ b/src/remind_event.py @@ -0,0 +1,22 @@ +import os +from functionality.highlights import get_event_list +import time +import datetime + +"""async def remind(ctx): + events = await get_event_list(ctx, "today")""" + +async def timer(ctx): + while True: + current_datetime = datetime.datetime.now() + + events = await get_event_list(ctx, "today") + for event in events: + event_time = event['startDateTime'] + event_time = datetime.datetime.strptime(event_time, '%Y-%m-%d %H:%M:%S') + time_difference = (event_time - current_datetime).seconds/60 + if (time_difference // 60) <= 10: + channel = ctx.create_dm() + await channel.send(f"You have {event['name']} scheduled , from {event['startTime']} to {event['endTime']}") + + time.sleep(60) # Fetch the time every 5 mins diff --git a/src/schedulebot.py b/src/schedulebot.py index 86f8fb9..be798a9 100644 --- a/src/schedulebot.py +++ b/src/schedulebot.py @@ -4,7 +4,7 @@ import json from discord.ext.commands.help import MinimalHelpCommand - +from remind_event import timer from functionality.AddEvent import add_event # type: ignore from functionality.highlights import get_highlight from functionality.create_event_type import create_event_type @@ -17,7 +17,7 @@ from functionality.GoogleEvent import get_events from functionality.Delete_Event import delete_event -bot = commands.Bot(command_prefix="!") # Creates the bot with a command prefix of '!' +bot = commands.Bot(command_prefix="!",intents=discord.Intents.all()) # Creates the bot with a command prefix of '!' bot.remove_command("help") # Removes the help command, so it can be created using Discord embed pages later g_flag=0 @@ -33,6 +33,7 @@ async def help(ctx): Output: An embed window sent to the context with all commands/descriptions """ + em = discord.Embed( title="ScheduleBot Commands", description="Here are all the commands to use ScheduleBot\nAll events are prefaced by an '!'", @@ -88,7 +89,6 @@ async def on_ready(): await msg.add_reaction("⏰") print("Sent Welcome Message to", text_channel_count, "Channel(s)") - @bot.event async def on_reaction_add(reaction, user): """ @@ -111,6 +111,8 @@ async def on_reaction_add(reaction, user): + "! I am ScheduleBot and I am here to make managing your schedule easier!" ) await help(user) + print(user) + await timer(user) except: print(user.name + " (" + user.id + ") does not have DM permissions set correctly") pass @@ -307,6 +309,10 @@ async def freetime(ctx): await get_free_time(ctx, bot) +async def remind_event(ctx, user): + await remind(ctx, user) + + # Runs the bot (local machine) if __name__ == "__main__": from config import TOKEN diff --git a/src/test.ipynb b/src/test.ipynb new file mode 100644 index 0000000..73bb7cb --- /dev/null +++ b/src/test.ipynb @@ -0,0 +1,264 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import time\n", + "import datetime" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "event = ['', 'test', '2023-10-18 02:26:00', '2023-11-18 02:26:00', '4', 'testing programming skills', '', 'none']" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "current_time = time.strftime(\"%H:%M\")\n", + "current_time = datetime.datetime.strptime(current_time, \"%H:%M\")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "event_time = event[2]\n", + "event_time = datetime.datetime.strptime(event_time, '%Y-%m-%d %H:%M:%S')" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "event_hour = event_time.hour\n", + "event_minute = event_time.minute\n", + "event__time = datetime.time(event_hour, event_minute)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.time(2, 26)" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "event__time" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "current_datetime = datetime.datetime.now()\n", + "current_hour = current_datetime.hour\n", + "current_minute = current_datetime.minute\n", + "current_time = datetime.time(current_hour, current_minute)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.time(18, 10)" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "current_time" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "unsupported operand type(s) for -: 'datetime.datetime' and 'datetime.time'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m/Users/sunday/brainfuck/se_final_schedule_bot_project/MyScheduleBot/src/test.ipynb Cell 9\u001b[0m line \u001b[0;36m1\n\u001b[0;32m----> 1\u001b[0m time_difference \u001b[39m=\u001b[39m event_time \u001b[39m-\u001b[39;49m current_time\n", + "\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for -: 'datetime.datetime' and 'datetime.time'" + ] + } + ], + "source": [ + "time_difference = event_time - current_time" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "minutes_difference = (event__time.hour - current_time.hour) * 60 + (event__time.minute - time1.minute)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "event = ['', 'test', '2023-10-18 02:26:00', '2023-11-18 02:26:00', '4', 'testing programming skills', '', 'none']" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "event_time = event[2]\n", + "event_time = datetime.datetime.strptime(event_time, '%Y-%m-%d %H:%M:%S')" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.datetime(2023, 10, 18, 2, 26)" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "event_time" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [], + "source": [ + "current_datetime = datetime.datetime.now()" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "datetime.datetime(2023, 10, 18, 18, 17, 44, 913417)" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "current_datetime" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "951.7333333333333" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "minutes = (current_datetime-event_time).seconds/60" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "a = '2023-10-18'\n", + "b = '6:25 PM'" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "discord_bot", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +}