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

Why Bot v2 #30

Draft
wants to merge 360 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
360 commits
Select commit Hold shift + click to select a range
c892134
updated zProl commmand to show compile errors
FusionSid Oct 7, 2022
eab2b2b
added custom emojis to info command
FusionSid Oct 8, 2022
9c7b66f
rickroll command / rickroll view
FusionSid Oct 9, 2022
17e27f0
Fixed issue where if timeout was < 0s it fucked up
FusionSid Oct 9, 2022
00682e9
added a function to auto add suffix to number like st, nd, rd, th. eg…
FusionSid Oct 9, 2022
94372b4
added a counter to rickroll view / claim command
FusionSid Oct 9, 2022
4d0f3bc
added ascii art command with colors and fonts
FusionSid Oct 9, 2022
76a640d
spongebob assets
FusionSid Oct 10, 2022
65019ef
change to the right licence
FusionSid Oct 10, 2022
8206d3c
Updated run cmd
FusionSid Oct 11, 2022
6a01726
font convert + cog check
FusionSid Oct 11, 2022
7c34563
cog check for run_bot_checks
FusionSid Oct 11, 2022
b752182
8ball
FusionSid Oct 11, 2022
1c232b4
safe calc + fast calc
FusionSid Oct 11, 2022
5e57c79
discord timestamp formatter
FusionSid Oct 11, 2022
0bedc00
get code command
FusionSid Oct 11, 2022
4a7e605
updated server info command
FusionSid Oct 11, 2022
76c4bce
Added random commands eg random roast, random number, random choice, …
FusionSid Oct 11, 2022
68565ee
added an emoji
FusionSid Oct 12, 2022
c4dbc35
runs setup func on guild join
FusionSid Oct 12, 2022
7ce83f2
updated to dif path
FusionSid Oct 12, 2022
f50ae99
Added some doc strings to make functions easier to use
FusionSid Oct 12, 2022
3c21f7b
dm reply / help working
FusionSid Oct 12, 2022
c93a0c3
fixed makefile errors
FusionSid Oct 12, 2022
57c5bb0
i may have stolen some more 8ball answers (credit: i got it from simp…
FusionSid Oct 12, 2022
bc7c11e
fixed dm reply bugs + added a command to close a thread
FusionSid Oct 12, 2022
3d89565
dmreply bug fixes
FusionSid Oct 12, 2022
8c065c8
Made it ignore command not found
FusionSid Oct 12, 2022
b8a92a6
Updated botinfo command and added a view with links at the bottom
FusionSid Oct 12, 2022
666dbdd
server file with fetch user / server cmds + server list command that …
FusionSid Oct 13, 2022
10b70e7
added ignore exceptions
FusionSid Oct 13, 2022
8a54d82
Added banning and kicking commands (+ their mass versions)
FusionSid Oct 13, 2022
db52f8a
git commands probably never will be used though
FusionSid Oct 13, 2022
c417c34
Added channel commands like clear, create/delete vc/channel, purgeuse…
FusionSid Oct 13, 2022
be013c1
Added hack fun command
FusionSid Oct 14, 2022
c1498b6
added poll command
FusionSid Oct 14, 2022
dbd3221
Added avatar command
FusionSid Oct 15, 2022
aad1ff9
Testing music
FusionSid Oct 16, 2022
8579452
added command usage state to fetch user info command
FusionSid Oct 17, 2022
1c39cee
created files for tag command (not started code yet)
FusionSid Oct 18, 2022
ae29134
added tag table sql query to create_tables
FusionSid Oct 18, 2022
1406ec8
added a small readme to explain project structure. Will make this bet…
FusionSid Oct 18, 2022
bb54682
updated requirements to include new packages
FusionSid Oct 18, 2022
1b86fbc
updated the readme and moved the discord card around
FusionSid Oct 18, 2022
2563712
added user context menu command for user info
FusionSid Oct 19, 2022
23c19e9
added screenshot command + updated requirements for it
FusionSid Oct 19, 2022
64dc932
added a button calculator view
FusionSid Oct 19, 2022
a9cdcfb
Added more slash & context menu commands
FusionSid Oct 19, 2022
bb609ff
Added view for confirming and denying requests
FusionSid Oct 22, 2022
1bcc231
Tic tac toe game with 2 player and ai mode
FusionSid Oct 22, 2022
cb15a8a
Changed the command names and some ephemeral messages
FusionSid Oct 22, 2022
e24535c
updated tic tac toe views and classes to subclass each other to save …
FusionSid Oct 22, 2022
b761934
edited the command info
FusionSid Oct 22, 2022
c2d8c9f
added command default permissions so admin commands are hidden
FusionSid Oct 22, 2022
596127c
switched the server info commands to slash commands
FusionSid Oct 22, 2022
60a2cfa
deleted git command files
FusionSid Oct 22, 2022
747aef6
Updated black to use the latest and expermental features
FusionSid Oct 22, 2022
d64db70
forgot to format some files so those formatted too
FusionSid Oct 22, 2022
78bcbd8
Made owner commands only work in owner servers
FusionSid Oct 23, 2022
1083f27
apoligise for my crime of shit code
FusionSid Oct 24, 2022
b400202
qrcode cmd + move code from info.py to utilities.py
FusionSid Oct 24, 2022
1c4e0ef
moved botinvite command to this file
FusionSid Oct 24, 2022
6fb7ed1
changed confirm view timeout
FusionSid Oct 24, 2022
f591580
rock paper scissors command + rps view
FusionSid Oct 24, 2022
9684bfc
ok maybe lets not use experimental features
FusionSid Oct 24, 2022
d939788
added IF NOT EXISTS to sql queries
FusionSid Oct 25, 2022
4223e9d
Made the whole setup.yaml file optional to setup/skipable
FusionSid Oct 25, 2022
2287a8d
updated apt command to not install additional unwanted packages
FusionSid Oct 25, 2022
bc10610
updated bare try excepts to the actual error to catch
FusionSid Oct 25, 2022
bff86fc
switched to safe loader for loading setup.yaml file
FusionSid Oct 25, 2022
ef3cd1a
Updated a bunch of files to include better type annotations and doc s…
FusionSid Oct 25, 2022
0bfb04a
updated venv script to source the venv
FusionSid Oct 25, 2022
3748bbb
Added bash script to create backups of the psql db
FusionSid Oct 25, 2022
05c8be2
updated gitignore so the backups folder is like john cena (git cant s…
FusionSid Oct 25, 2022
6bdd42b
updated backup file names to d/m/y THE BETTER WAY
FusionSid Oct 26, 2022
bad8f37
made it have placeholder fields to replace later
FusionSid Oct 26, 2022
c373b73
Added cog checks to rps and tictactoe
FusionSid Oct 28, 2022
05171a6
removed useless time import from counting
FusionSid Oct 28, 2022
ed4d385
added alert table queries + updated tags query to datetime object
FusionSid Oct 28, 2022
a085cb0
finished v1 of alert system and tested it. TODO: add a way for the ow…
FusionSid Oct 28, 2022
01fce69
heads or tails image assets
FusionSid Oct 28, 2022
ec7483f
added command to get dominant color and color palette from image
FusionSid Oct 28, 2022
0e5ab9f
Added random card, flipcoin, diceroll, random color, random letter and
FusionSid Oct 28, 2022
477c05b
Fixed bug in get last error command
FusionSid Oct 29, 2022
c65f541
Made applicationinvokerror log the original cause and not just itself
FusionSid Oct 29, 2022
22ac097
moved chunkify code from server.py to its own util
FusionSid Oct 29, 2022
810cee1
Updated requirements
FusionSid Oct 29, 2022
54c30c2
added auto install to requirements
FusionSid Oct 29, 2022
8302d92
added error catcher to install part in setup.py incase theres an error
FusionSid Oct 29, 2022
88c063b
Removed asignment of None to db & redis attrs in the WhyBot class
FusionSid Oct 30, 2022
4c18c89
Switched version to be a parameter of WhyBot class init to ensure mai…
FusionSid Oct 30, 2022
fab1c97
doc string + type annotations to chunkify function
FusionSid Oct 30, 2022
952354c
reduced complexity of ordinal suffix function. (cause im legit forget…
FusionSid Oct 30, 2022
78bf4ea
Switched with open blocks (in async functions) to use aiofiles.open i…
FusionSid Oct 30, 2022
e3c3d3c
added 9 new animal commands from somerandomapi + OK I PULL UP (capyba…
FusionSid Oct 30, 2022
c4591ac
created custom exception (ImageAPIFail) for when i fail to get an ima…
FusionSid Oct 30, 2022
67235e8
updated bot info command to show version, uptime timestamp, creator a…
FusionSid Oct 30, 2022
2fd472d
fixed issue where i was using excepthook instead of __excepthook__ fo…
FusionSid Oct 30, 2022
5fcba68
added code ql work flow
FusionSid Oct 30, 2022
0f7518a
removed javascript from codeql workflow as im not using js
FusionSid Oct 30, 2022
977233f
removed random comment and optional thing
FusionSid Oct 30, 2022
3a634d9
Added .vscode folder with snippet to create a cog quickly
FusionSid Nov 1, 2022
ed8b141
Fixed syntax error in command_stats table query
FusionSid Nov 1, 2022
a393e64
Added command to check the most recent commit to repo
FusionSid Nov 2, 2022
cc67428
Updated setup py for new field (github access token)
FusionSid Nov 2, 2022
d5a47ac
created a view for making link buttons
FusionSid Nov 2, 2022
99bd7c5
Added auto github issue creation to bug report command & switched lin…
FusionSid Nov 2, 2022
59902b4
fixed file reading error where i was using json.load instead of loads
FusionSid Nov 2, 2022
c6ad7e2
put video creation in the crab command into asyncio task so it runs i…
FusionSid Nov 2, 2022
ff64a60
Changed the few places i forgot to use display name to use display na…
FusionSid Nov 2, 2022
ca03c8c
Added wavelink to requirements
FusionSid Nov 2, 2022
ea39bc1
added deepsource toml config file so i can test out deepsource
FusionSid Nov 2, 2022
270ff48
updated deepsource toml file to include stuff from master branch
FusionSid Nov 2, 2022
ef11804
changed == to is when i was comparing variable to True/False
FusionSid Nov 2, 2022
f52c0c5
Removed anomalous backslashes
FusionSid Nov 2, 2022
d17414d
changed for loop to all to improved readability and shorten code
FusionSid Nov 2, 2022
dc59c30
removed unnececary generator from level role blacklist check
FusionSid Nov 2, 2022
b5561c0
removed useless super() init calls from ttt classes
FusionSid Nov 2, 2022
3b31eda
switched list comprehention to instead call the list() function
FusionSid Nov 2, 2022
62c6703
changed == 0 and == None to just use in operator (in (0, None))
FusionSid Nov 2, 2022
13dc32c
Converted on line doc strings to actually only use 1 line instead of 3
FusionSid Nov 2, 2022
433dc35
removed usage of the len function when checking if itterable is empty
FusionSid Nov 2, 2022
4939c66
Changed functions not using selef in fun cogs to use staticmethods
FusionSid Nov 2, 2022
b8a32f2
removed accidental expression and list comprehension
FusionSid Nov 2, 2022
1266894
simplex bug fixes like using == None instead of is
FusionSid Nov 2, 2022
a289b21
stopped using variables from inside the loop and made a new variable …
FusionSid Nov 2, 2022
9ba75a8
call super init on subclasses
FusionSid Nov 2, 2022
10d9263
fixed subclassing & ephemeral bugs in tic tac toe
FusionSid Nov 2, 2022
dffcf81
Fixed imagemagik/moviepy issue in docker containers
FusionSid Nov 2, 2022
a1deb1e
Cleaned up dockerfile by adding comments and using backslashes to put…
FusionSid Nov 2, 2022
86ef29a
changed codeql action to only watch for changes to python files
FusionSid Nov 2, 2022
79304d5
Added v1 of privacy policy adapted from freeCodeCamp
FusionSid Nov 2, 2022
0358334
Added timestamp for when the commit was made to recent commit command
FusionSid Nov 3, 2022
2834bda
removed discord timestamp and added privacy policy link to botinfo
FusionSid Nov 3, 2022
d65d082
Type annotated all occurences of ctx with discord.ApplicationContext
FusionSid Nov 3, 2022
7dde128
Updated privacy policy to include guild and command stat collecition
FusionSid Nov 3, 2022
085017f
renamed variable cause it wasnt being used
FusionSid Nov 3, 2022
d661c7a
chore: delete unused TOS.md file
FusionSid Nov 6, 2022
f213f2f
feat: add contributor code of conduct (Contributor Covenant)
FusionSid Nov 6, 2022
9e98591
docs: Add comments to the bots startup function
FusionSid Nov 6, 2022
4a6a9c7
fix: Fix accidental use of parenthesis instead of square brackets
FusionSid Nov 6, 2022
f9df1d9
fix: make clean command deleting .vscode folder
FusionSid Nov 6, 2022
4248f25
feat: Add command for server owners to configure xp awarded
FusionSid Nov 6, 2022
c67ec22
chore: Add progress bar to wget commmand
FusionSid Nov 6, 2022
8213f2f
fix: Fix issue with divmod and current level xp calculation which was…
FusionSid Nov 6, 2022
85ea8fd
feat: Add XP calculator command to get xp required for next level or …
FusionSid Nov 6, 2022
94aed58
refactor: Add extra typing annotations (mainly typing.Optional) to fi…
FusionSid Nov 13, 2022
61aba56
feat: Add flake8 linter configuration file
FusionSid Nov 26, 2022
c6a0183
style(line): Reduce line length on error handler code
FusionSid Nov 26, 2022
7fa7c47
docs(comment): Add comments to on_ready and on_message client events
FusionSid Nov 26, 2022
896a6a2
refac: Switch f strings to regular string in instances where there ar…
FusionSid Nov 26, 2022
f649d3d
fix(linter): Stop flake8 warning for annotation issue with discord.Op…
FusionSid Nov 26, 2022
d316c7f
refactor(W291): Remove extra whitespace on line
FusionSid Nov 26, 2022
55df315
style(line-E501): Reduce line length
FusionSid Nov 26, 2022
20c5670
refac: Switch f strings to regular string in instances where there ar…
FusionSid Nov 26, 2022
6979ca5
refac: Switch unnececary f strings to regular strings
FusionSid Nov 26, 2022
e5190b5
feat(command): Add Capybara, Duck & Shibe animal picture commands
FusionSid Dec 7, 2022
90ebba7
fix: Fix image NoneType bug in duck and capybara commands
FusionSid Dec 7, 2022
8e0ecba
feat(command): Add whale image command
FusionSid Dec 7, 2022
cee73dc
chore(command): Add ImageURLS enums with urls for useful api endpoints
FusionSid Dec 7, 2022
f8aa341
feat(command): Add random unsplash image command with search terms su…
FusionSid Dec 7, 2022
48c40b7
chore: Update requirements for dateutil package
FusionSid Dec 7, 2022
bbfcbce
fix: Spelling error in capybara image endpoint
FusionSid Dec 7, 2022
608774b
fix: Spelling error in capybara image endpoint
FusionSid Dec 7, 2022
73af994
fix: UniqueViolationError psql bug on guild join
FusionSid Dec 7, 2022
7a42e32
feat: Put error messages in code blocks for get last error command
FusionSid Dec 7, 2022
01882a5
fix: Convert regular string that should have been a fstring to a fstring
FusionSid Dec 7, 2022
72c6fc0
fix(ttt): Patch bug in tictactoe where view continues to run after th…
FusionSid Dec 8, 2022
c2e7156
fix(command): Patch clear command unintentionally purging 1 extra mes…
FusionSid Dec 8, 2022
89c43a0
chore: Edit contributions section of readme to include conventional c…
FusionSid Dec 8, 2022
4847fa2
fix: Simple spelling and grammar issues in Privacy Policy
FusionSid Dec 8, 2022
a34bc39
feat: Add TagInput view for tags and alerts commands
FusionSid Dec 9, 2022
e632ff3
fix: Update datatype of time_created attribute from Tag class
FusionSid Dec 9, 2022
1cd4573
feat: Add new alert creation command (+fix: timestamp issue)
FusionSid Dec 9, 2022
317e1d5
feat: Cause create_tables() function to drop tables before re-creatin…
FusionSid Dec 9, 2022
48a35c8
feat(tags): Add tags system to bot with several commands
FusionSid Dec 9, 2022
c65c94d
chore: Remove python badge from readme
FusionSid Dec 9, 2022
217d8d9
fix(alert): Reset alert_viewed to false when new alert is created
FusionSid Dec 9, 2022
44941f6
feat: Add snippet for creating a slash command
FusionSid Dec 9, 2022
6a86f9e
fix: Remove debug print from leveling
FusionSid Dec 10, 2022
b9f9a75
feat: Add addrole and removerole commands
FusionSid Dec 10, 2022
b9d9b6f
refactor: Rename TagInput class to InputModalView to make it more reu…
FusionSid Dec 12, 2022
64bc8f9
refactor: Use InputModalView instead of TagInput class
FusionSid Dec 12, 2022
10d66f5
feat: Rename whydev to why to shorten slash command name length
FusionSid Dec 12, 2022
3c56a31
feat: Add database queries for new ticket tables
FusionSid Dec 12, 2022
14fafb9
feat: Add function to setup ticket guild config
FusionSid Dec 12, 2022
ff5ae88
feat: Create helper ticket dataclasses
FusionSid Dec 12, 2022
a0823f8
feat: Add priv class methods to get tickets and ticket config
FusionSid Dec 12, 2022
62fd038
fix(PYL-C1802): Shorten if len(x) to if x to avoid Built-in len used …
FusionSid Dec 12, 2022
6396000
fix(PY-W0073): Escape anomalous backslashes in code with an extra bac…
FusionSid Dec 12, 2022
7e70409
perf(issue38): Patch performance bug where math evaluation takes 15sec
FusionSid Dec 16, 2022
d527ed0
feat: Congratulate user on highscore and other numbers instead of jus…
FusionSid Dec 17, 2022
11eee44
fix: Update to only hide actual config and allow example
FusionSid Dec 17, 2022
bb1012d
feat: example config file
FusionSid Dec 17, 2022
b2318de
fix: Get guild id values from config instead of hard coded values
FusionSid Dec 17, 2022
5105170
chore: Define constant for guild_ids for restricting slash commands
FusionSid Dec 19, 2022
10d6d69
chore: Add additional ignore cases
FusionSid Dec 19, 2022
d5446cf
docs: Update comment to be more accurate
FusionSid Dec 19, 2022
35f3bbe
feat: Use guild_ids constant instead of hardcoded list for slash comm…
FusionSid Dec 19, 2022
7af210a
refac: Use function from core rather than from library
FusionSid Dec 19, 2022
f1e98b2
feat: Add a description to all slash commands
FusionSid Dec 19, 2022
a19aebb
feat: Add/fix IPC server + client
FusionSid Dec 20, 2022
5e7b15c
fix: Spelling issue in column name
FusionSid Dec 20, 2022
a6b714a
feat: Ticket system v1.
FusionSid Dec 20, 2022
7a03bec
chore: Update requirements to include chat_exporter
FusionSid Dec 20, 2022
d84558f
fix(BAN-B104): Fix potential security vulnerability when binding to a…
FusionSid Dec 20, 2022
e5bf725
perf(PYL-R0201): Convert method that doesn't use the class to staticm…
FusionSid Dec 20, 2022
5006f09
feat: Add new ticket button view
FusionSid Dec 20, 2022
7b75978
feat: Add command to create persitent new ticket view + add on ready
FusionSid Dec 20, 2022
e0b76f0
fix: Forgot brackets in random color method so added them
FusionSid Dec 20, 2022
7f4b833
feat: Let user choose the ipc host address
FusionSid Dec 23, 2022
698200e
feat(ticket): Added a slash command for all ticket functions
FusionSid Dec 23, 2022
6436c7d
feat: Add decorator to print the runtime of a function
FusionSid Dec 23, 2022
a9f97d5
fix: Ticket creation issue where roles are not pinged
FusionSid Dec 23, 2022
35aa709
fix: Fix order of counting data in table and uncomment banned users
FusionSid Dec 24, 2022
79e335e
fix: Syntax error in sql query
FusionSid Dec 24, 2022
8e266f0
feat: Make all counting alert replies use __delete_msg
FusionSid Dec 24, 2022
6425a40
feat: Add ban and unban user from counting commands
FusionSid Dec 24, 2022
2994e47
fix: make default counting data include an empty array
FusionSid Dec 24, 2022
4cfa28f
fix: Remove annoying highscore alert
FusionSid Dec 24, 2022
719c741
feat: Add button on lasterror cmd to send error as text file
FusionSid Dec 24, 2022
6316fe4
feat: Changed my mind and decided to use an init.py for shorter imports
FusionSid Dec 26, 2022
6a46171
refac: Made timestamp & numbersuffix functions non async
FusionSid Dec 26, 2022
d73ec8b
fix: Remove return resp parameter from http helper functions
FusionSid Dec 26, 2022
bc3ccc2
refactor: xp_needed function does not need to be async
FusionSid Dec 26, 2022
85c7b25
refactor: Add init py for core helper directory
FusionSid Dec 26, 2022
9ee6a30
refactor(imports): Massive refactoring of import from the core module
FusionSid Dec 26, 2022
af11344
refactor: Import new TABLES_TO_CREATE const in core.db
FusionSid Dec 26, 2022
c56aec6
fix: Usage of wrong variable name in create tables function
FusionSid Dec 27, 2022
cca27d7
chore: Update ignore cases for flake8 and turn off strict types checking
FusionSid Dec 27, 2022
58470a1
chore: Create docs dir and empty selfhost guide (TODO)
FusionSid Dec 28, 2022
4e42551
fix: Fix syntax error and update to include IPC info
FusionSid Dec 28, 2022
c1c1586
feat: Add v2 setup.py script to make setting up the bot much easier
FusionSid Dec 28, 2022
20517a3
fix(BAN-B607): Made clear command easier + fixed starting a process w…
FusionSid Dec 28, 2022
2b3d452
fix(F541): Update f-strings that miss placeholders to regular strings
FusionSid Dec 28, 2022
4334bd5
fix(E731): asigning a var to a lambda expression
FusionSid Dec 28, 2022
43aa903
fix: Fix flake8 issues: E302, F401 and F841
FusionSid Dec 28, 2022
8719c95
fix(E501): Lines too long
FusionSid Dec 28, 2022
8afd1ce
fix(E501): Lines too long
FusionSid Dec 28, 2022
730f113
chore: Add warning saying not to modify file
FusionSid Dec 31, 2022
a72e478
feat: Add flake8 & reorder-python-imports hooks
FusionSid Dec 31, 2022
5f60a76
fix: Remove reorder-python-imports as it doesn't detect THE CORE FOLDER
FusionSid Dec 31, 2022
53ba030
chore: Remove duplicate ignore case
FusionSid Jan 1, 2023
7780aa6
fix: Use get method for priv emojies and add defaults
FusionSid Jan 1, 2023
d302ce4
chore: Add image assets for selfhosting guide
FusionSid Jan 1, 2023
148e52f
feat: add exec_code command (unsafe), remove duplicate CodeInput modal
FusionSid Jan 11, 2023
8725859
feat: add font for spongebob command
FusionSid Jan 20, 2023
37a36fa
feat: add spongebob timecard command
FusionSid Jan 20, 2023
177f16e
fix: update requiremenets to include aioconsole
FusionSid Jan 20, 2023
1a05a3d
fix: incorrect file name causing error opening font
FusionSid Jan 20, 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
8 changes: 8 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version = 1

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
9 changes: 0 additions & 9 deletions .env.example

This file was deleted.

4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = E203, W503, E266, F722, F821, E999
max-line-length=120
max-complexity=39
42 changes: 42 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "CodeQL"

on:
push:
paths:
- "src/**.py"
branches: ["master", "rewrite-the-rewrite"]
pull_request:
branches: ["master", "rewrite-the-rewrite" ]
schedule:
- cron: '38 17 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
38 changes: 32 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
.env
.DS_Store
.breakpoints
*__pycache__
*.db
*.json
log.txt
*.DS_Store
*.env
*.pyc
*__pycache__/
*venv/
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.cache
.env
config.yaml
*.log
*.so
*.mypy_cache
*logfiles/
*testing_cog.py
src/scripts/backups
src/scripts/b.sh
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--safe]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.typeCheckingMode": "off"
}
27 changes: 27 additions & 0 deletions .vscode/why.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"newcog": {
"prefix": "newcog",
"body": [
"import discord",
"from discord.ext import commands\n",
"from core.models import WhyBot",
"from core.helpers.checks import run_bot_checks\n",
"class $1(commands.Cog):",
"\tdef __init__(self, client: WhyBot):",
"\t\tself.client = client",
"\t\tself.cog_check = run_bot_checks\n\n\n",
"def setup(client):",
"\tclient.add_cog($1(client))"
],
"description": "Creates a Cog"
},
"slash": {
"prefix": "slash",
"body": [
"@commands.slash_command()",
"async def $1(self, ctx: discord.ApplicationContext):",
"\tpass"
],
"description": "Create a new slash command"
}
}
78 changes: 78 additions & 0 deletions COC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

# Collaborator's Code of Conduct

## Our commitment

In the interest of promoting an open and welcoming environment, we
contributors and maintenance workers we are committed to making participation in our
project and our community an experience free from harassment for
all, regardless of age, build, disability, ethnicity,
sexual characteristics, identity and gender expression, level of
experience, education, socio-economic status, nationality, appearance, race,
religion or identity and sexual orientation.

## Our Standards

Examples of behaviors that contribute to creating an environment
positive:

* Use of a welcoming and inclusive language
* Respect different points of view and experiences
* Accept constructive criticism gracefully
* Focus on what's best for the community
* Show empathy towards other community members

Examples of unacceptable behavior of participants:

* The use of language or sexualized images and sexual attention or
unwanted advances
* Troll behavior, offensive comments and personal or political attacks
* Harassment in public or private
* Publication of other people's private information, such as a postal address or
electronic, without explicit authorization
* Other behaviors that could reasonably be considered
inappropriate in a professional context

## Our responsibilities

Project maintainers are responsible for clarifying the standards of
acceptable behavior and are required to take corrective action
appropriate and fair in response to any case of unacceptable behavior.

Project maintainers have the right and responsibility to remove,
modify or reject comments, commits, code, changes to wikis, issuee and others
contributions not aligned with this Code of Conduct, or to exclude,
temporarily or permanently, any contributor for
behaviors deemed inappropriate, threatening, offensive or harmful.

## Purpose

This Code of Conduct applies both within the spaces of the
project that in public spaces when an individual represents the project
or its community. Examples of representation of a project or community
include the use of an official project email address, publication
through an official account through social media or the function of
designated representative at an online or offline event. The representation of a
project can be further defined and clarified by the project maintainers.

## Application

Cases of abusive, harassing or otherwise unacceptable behavior can
be presented by contacting the project leader at
`[email protected]` or by DMing `FusionSid#3645`. All complaints will be reviewed and investigated and give
place of an answer deemed necessary and appropriate to the circumstances. The
project team is obliged to maintain confidentiality regarding
the person who reported the case.
Further details on specific implementation policies can be
published separately.

Project maintainers who do not respect or apply the Code of
Behavior in good faith may suffer temporary repercussions or
permanent as determined by other members at the helm of the project.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[ homepage ]: https://www.contributor-covenant.org
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM python:3.10-slim

# install packages
RUN apt-get update && apt-get install -y --no-install-recommends \
git unzip wget fontconfig imagemagick fonts-symbola \
libmagick++-dev gcc ffmpeg python3-dev && rm -rf /var/lib/apt/lists/*

# Set work dir as root
WORKDIR /

# copy all the files from project to container
COPY ./ ./

# set work dir as src kinda like cd-ing into it and staying there
WORKDIR /src

# Configure imagemagick settings
RUN sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
RUN cat /etc/ImageMagick-6/policy.xml | sed 's/none/read,write/g'> /etc/ImageMagick-6/policy.xml
RUN sed -i_bak 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml

# install verdana font for crab command
RUN wget --progress=dot:giga "https://www.dafontfree.io/download/verdana/?wpdmdl=71901&refresh=6362eb8bd1a9e1667427211&ind=1612703173429&filename=verdana-font-family.zip" -O font.zip
RUN unzip font.zip -d font
RUN cp -r font/* /usr/local/share/fonts

# reload font cache
RUN fc-cache -f -v

# Install required packages from requirements.txt
RUN pip install -r requirements.txt --no-cache-dir

# run the bot :)
CMD ["python3", "main.py"]
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Siddhesh Zantye (FusionSid)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading