-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
583 additions
and
1,170 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-python.python", | ||
"charliermarsh.ruff" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"[python]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"files.exclude": { | ||
"**/__pycache__": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
DISCORD_TOKEN=Your Discord bot token. | ||
JISHAKU_NO_UNDERSCORE=1 | ||
JISHAKU_HIDE=1 | ||
DISCORD_TOKEN=Your Discord bot token. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
[tool.poetry] | ||
name = "scnewsbot" | ||
version = "1.0.3" | ||
version = "2.0.0" | ||
description = "A bot for the r/starcitizen Discord server." | ||
authors = ["mudkipdev <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
packages = [ | ||
{ include = "scnewsbot" } | ||
] | ||
readme = ".github/README.md" | ||
packages = [ { include = "scnewsbot" } ] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
discord-py = "^2.3.2" | ||
jishaku = "^2.5.2" | ||
python = "3.12.4" | ||
python-dotenv = "^1.0.1" | ||
uvloop = "^0.19.0" | ||
hikari = { extras = ["speedups"], version = "^2.0.0.dev126" } | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
black = "^24.3.0" | ||
ruff = "^0.5.4" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
import tomllib | ||
import os | ||
from hikari import GatewayBot, Intents | ||
from dotenv import load_dotenv | ||
from bot import Bot | ||
from utils import Config | ||
|
||
|
||
class InvalidTokenException(Exception): | ||
pass | ||
|
||
|
||
def main() -> None: | ||
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN") | ||
if not DISCORD_TOKEN: | ||
raise InvalidTokenException("A Discord token was not set.") | ||
load_dotenv() | ||
token = os.getenv("DISCORD_TOKEN") | ||
|
||
if not token: | ||
print("Please set a DISCORD_TOKEN environment variable.") | ||
exit(1) | ||
|
||
with open("config.toml", "rb") as config_file: | ||
config = Config(tomllib.load(config_file)) | ||
if os.name != "nt": | ||
import uvloop | ||
uvloop.install() | ||
|
||
bot = Bot(config) | ||
bot.run(DISCORD_TOKEN) | ||
bot = GatewayBot(intents=Intents.ALL_UNPRIVILEGED, token=token) | ||
bot.run() | ||
|
||
|
||
if __name__ == "__main__": | ||
load_dotenv() | ||
main() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.