Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Port to discord.py v2.0 and snakecore (#381)
Browse files Browse the repository at this point in the history
* begin porting PygameCommunityBot to discord.py v2.0

* run black

* add snakecore as a dependency from GitHub repository

* fix missing attribute from port

* add thread messaging support, fix bugs relating to avatar/icon Asset objects

* add support for receiving  messages from threads in bot commands

* fix embed refresh bug, sort requirements.txt

* Fully port codebase to use `snakecore.utils` (#378)

* begin porting to snakecore utils modules

* partial port of snakecore.embed_utils

* finish porting to snakecore utility modules

* fix relocated constant typo

* fix string typo for message browse command

* add inactivity timeout parameter in EmbedPaginator

* replace removed Messageable.trigger_typing with Messageable.typing

* Port command system to `discord.ext.commands` (#380)

* begin porting to discord.ext.commands

* begin porting to discord.ext.commands 2

* finish porting command codebase to discord.ext.commands, many heavy improvements and fixes

* revamp code for controlling the deletion of repsonse messages using reaction

* add some extra references for globally used asyncio task objects (port)

* improved command refresh command

* add more module docstrings

* fix typos, simplify decorator code

* improve command error handling, improvements

* fix imports and change command decorators

* fix imports and change command decorators

* remove CustomContext, improvements

* more import cleanups

* more import cleanups

* prefer self.bot over common.bot in cogs

* tweak clock command

* abstract away common.global_task_set

* tweak command refreshing code

* modularize commands module into extensions, use pseudo DB from snakecore, delete emotion-related functionality and unused modules, implement bootstrap.json, various refactorings

* run black

* remove unused files

* rename constants, remove more unneeded code

* add bootstrap runtime override code

* add missing assets

* fully restructure entire codebase, turn command modules into extensions fixes and improvements

* more fixes and improvments

* update README

* Major Codebase Refactoring: Adhere to `bot-template` repository structure (#383)

* modularize commands module into extensions, use pseudo DB from snakecore, delete emotion-related functionality and unused modules, implement bootstrap.json, various refactorings

* remove unused files and modules, rename constants

* more fixes and improvments

* update README and project requirements to Python 3.9

* correct some string inconsistencies

* add optional uvloop dependency for optimization

* add discord logging configuration, fixes and improvements

* fix malfunctioning discord bot console

* improve RedirectTextIOWrapper class

* fix output bug in 'sudo' command

* fix error in 'sudo edit' command

* add group_by_author_timedelta kwarg to 'archive' command

* fix error in previous commit

* fix error in previous commit 2

* use snakecore 0.1.0 as a dependency version

* change code formatter line-length to 88, improve command enabling/disabling, update runtime.txt

* update setup.cfg

* fix 'sudo edit' command bug
  • Loading branch information
Mega-JC authored Aug 7, 2022
1 parent 0011e47 commit 1fd01cc
Show file tree
Hide file tree
Showing 49 changed files with 4,782 additions and 7,130 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ dmypy.json
# Cython debug symbols
cython_debug/

### Visual Studio Code template
### Visual Studio (Code) IDEs
.vs/*
*.sln
.vscode/*
*.code-workspace

Expand All @@ -148,3 +150,9 @@ cython_debug/

### JetBrains IDEs
.idea/

# MacOS
.DS_Store

# Windows
desktop.ini
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-present PygameCommunityDiscord
Copyright (c) 2020-present pygame-community

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
worker: python3 main.py
worker: python3 -m pgbot
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The bot is licensed under the [MIT license](LICENSE).

- When you get the 'sorcerer' role on the discord server, you will be given the token of the test bot.
- You can then run the bot locally on your local setup to test the bot.
- Make sure you have python 3.7 or above, install the deps with `pip install -r requirements.txt`
- Make sure you have python 3.9 or above, install the deps with `pip install -r requirements.txt`

- Make a `.env` file at the base dir (this is git-ignored), and set it like

Expand All @@ -28,4 +28,4 @@ TEST_USER_ID = 1234567890 # your discord ID

## Running the bot on your server

- In addition to the above steps, if you want to get the bot started on your own server, you'd need to make some code changes, in the `common.py` file, you would either need to set the bot on "generic" mode, where the server specific features are disabled, or alternatively, rewrite `ServerConstants` class, but with the constants from your server. Don't forget to revert these changes when you send us a PR!
- In addition to the above steps, if you want to get the bot started on your own server, you'd need to make some code changes, in the `common.py` file, you would either need to set the bot on "generic" mode, where the server specific features are disabled, or alternatively, rewrite `GuildConstants` class, but with the constants from your server. Don't forget to revert these changes when you send us a PR!
File renamed without changes.
Binary file removed assets/images/die.gif
Binary file not shown.
Binary file removed assets/images/pet.gif
Binary file not shown.
30 changes: 0 additions & 30 deletions cleancode.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
84 changes: 0 additions & 84 deletions main.py

This file was deleted.

Loading

0 comments on commit 1fd01cc

Please sign in to comment.