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

Merge rewrite branch with master #68

Merged
merged 5 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 64 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[flake8]
count = true
max-line-length = 120
show_source = True
statistics = True

# Mostly taken from the flake8 documentation
ignore =
# F812: list comprehension redefines ...
F812,
# H101: Use TODO(NAME)
H101,
# H202: assertRaises Exception too broad
H202,
# H233: Python 3.x incompatible use of print operator
H233,
# H301: one import per line
H301,
# H306: imports not in alphabetical order (time, os)
H306,
# H401: docstring should not start with a space
H401,
# H403: multi line docstrings should end on a new line
H403,
# H404: multi line docstring should start without a leading new line
H404,
# H405: multi line docstring summary not separated with an empty line
H405,
# H501: Do not use self.__dict__ for string formatting
H501
# T101: Fix todos
T101
# E402: module level import not at top of file
E402
# CFQ002: Function has 7 arguments that exceeds max allowed 6
CFQ002
# CFQ004: Function has 8 returns that exceeds max allowed 3
CFQ004
# E722: do not use bare 'except'
E722
# W503: line break before binary operator
W503

per-file-ignores =
# imported but unused
__init__.py: F401, F403, W291

exclude =
.git,
.idea,
.vs,
.vscode,
__pycache__,
docs,
build,
dist,
venv,
breaking,
.github,
tests-dev,

accept-encodings = utf-8
max-complexity = 19
docstring-convention = numpy
18 changes: 10 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ version: 2
formats: []

build:
image: latest
os: ubuntu-20.04
tools:
python: "3.9"

sphinx:
configuration: docs/conf.py
fail_on_warning: false
builder: html

python:
version: "3.8"
install:
install:
- method: pip
path: .
extra_requirements:
- docs
- docs

sphinx:
configuration: docs/conf.py
fail_on_warning: false
builder: html
47 changes: 3 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ Asynchronous Discord API Wrapper for Python

## Features

- Sane Handling of 429s
- User friendly interface
- Most Gateway events
**Discord.io is currrently facing a rewrite, we'll make sure to beautify this when we have time.**

## Installing

Expand All @@ -35,46 +33,7 @@ To install our speed requirements just run the following command:
pip install discord.io[speed]
```

For voice support run the following command:

```py
pip install discord.io[voice]
```

## Examples
This is a quick usecase example for the library!

```py
import discord

client = discord.Client()

@client.event
async def on_ready():
print('ready!')

@client.slash_command()
async def ping(interaction):
await interaction.respond('pong!')

client.run('my_bot_token')
```

This is another example but with a prefixed command

```py
from discord.ext import commands

bot = commands.Bot(command_prefix='!')

@bot.command()
async def ping(ctx):
await ctx.send('pong!')

bot.run('my_bot_token')
```

## Useful Links

The d.io [discord server](https://discord.gg/cvCAwntVhm)
The d.io [docs](https://discordio.readthedocs.io/)
- [Discord server](https://discord.gg/cvCAwntVhm)
- [Documentation](https://discord.readthedocs.io/)
29 changes: 2 additions & 27 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,12 @@
__author__: str = 'VincentRPS'
__license__: str = 'MIT'
__copyright__: str = 'Copyright 2021-present VincentRPS'
__version__: str = '1.0.0'
__version__: str = '2.0.0'
__git_sha1__: str = 'HEAD'

import logging
import typing

from .api import *
from .assets import *
from .channels import *
from .client import *
from .color import *
from .colour import *
from .ui import *
from .embed import *
from .enums import *
from .events import *
from .file import *
from .flags import *
from .guild import *
from .http import *
from .interactions import *
from .internal import *
from .member import *
from .message import *
from .snowflake import *
from .state import *
from .types import *
from .user import *
from .utils import *
from .webhooks import *


class VersionInfo(typing.NamedTuple):
major: str
Expand All @@ -51,7 +26,7 @@ class VersionInfo(typing.NamedTuple):
serial: int


version_info: VersionInfo = VersionInfo(major=1, minor=0, micro=0, releaselevel='final', serial=0)
version_info: VersionInfo = VersionInfo(major=2, minor=0, micro=0, releaselevel='alpha', serial=0)

logging.getLogger(__name__).addHandler(logging.NullHandler())

Expand Down
77 changes: 0 additions & 77 deletions discord/abc.py

This file was deleted.

117 changes: 0 additions & 117 deletions discord/activites.py

This file was deleted.

Loading