Skip to content

Commit

Permalink
Merge pull request #10 from pyrevolt/development
Browse files Browse the repository at this point in the history
v0.2.6-a
  • Loading branch information
GenericNerd committed Apr 29, 2022
2 parents b3d3e2b + 9820ec3 commit fd264ba
Show file tree
Hide file tree
Showing 25 changed files with 2,812 additions and 1,037 deletions.
7 changes: 7 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.10"
sphinx:
configuration: docs/source/conf.py
695 changes: 21 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Python library to wrap the Revolt API, made to be easy-to-use but powerful and
</div>
<div align="center">

[![Version](https://img.shields.io/badge/version-0.1.4--a-red)](https://img.shields.io/badge/version-0.1.4--a-red) [![Stability](https://img.shields.io/badge/stability-Use%20if%20experienced-important)](https://img.shields.io/badge/stability-Use%20if%20experienced-important)
[![Version](https://img.shields.io/badge/version-0.2.6--a-red)](https://img.shields.io/badge/version-0.2.6--a-red) [![Stability](https://img.shields.io/badge/stability-Exceptions%20likely-yellowgreen)](https://img.shields.io/badge/stability-Exceptions%20likely-yellowgreen) [![Support Server](https://img.shields.io/badge/support-Revolt%20Server-informational)](https://app.revolt.chat/invite/mNygJpqw) [![Documentation Status](https://readthedocs.org/projects/pyrevolt/badge/?version=latest)](https://pyrevolt.readthedocs.io/en/latest/?badge=latest)
</div>

## Installing pyrevolt
Expand All @@ -13,7 +13,7 @@ A Python library to wrap the Revolt API, made to be easy-to-use but powerful and
To install pyrevolt, you can run the following command:
```python
# Linux/macOS command
python3 -m pip install py revolt
python3 -m pip install pyrevolt
# Windows
py -m pip install pyrevolt
```
Expand All @@ -23,30 +23,36 @@ This shows a very quick example of how to use pyrevolt. As a note, pyrevolt is s
```py
import pyrevolt

bot = pyrevolt.Bot()
bot = pyrevolt.Bot(prefix="!")

@bot.on(pyrevolt.GatewayEvent.Ready)
async def onReady(users: dict[pyrevolt.User], channels: dict[pyrevolt.Channel], servers: dict[pyrevolt.Server]) -> None:
@pyrevolt.ReadySimplified()
async def onReady() -> None:
print("Ready!")

@bot.on(pyrevolt.GatewayEvent.OnMessage)
async def onMessage(message: pyrevolt.Message) -> None:
print(f"{message.author.username} said: {message.content}")
if message.content == "!ping":
await message.Send(content=f"Pong {message.author.username}!", embeds=[pyrevolt.Embed.Create(title="Pong!", description=f"{message.author.mention}!", colour="#0000ff")], replies=[pyrevolt.Reply(message.messageID, True)])
logChannel: pyrevolt.Channel = await bot.GetChannel("01FYEQGD3P7WJ6ST36QFPBT10Z")
await logChannel.Send(content=f"{message.author.username} said: {message.content}")

@bot.commands.Command(name="ping")
async def ping(message: pyrevolt.Message) -> None:
await message.Send(content=f"Pong {message.author.username}!", embeds=[pyrevolt.Embed.Create(title="Pong!", description=f"{message.author.mention}!", colour="#0000ff")], replies=[pyrevolt.Reply(message.messageID, True)])

@bot.commands.Command(name="hello", aliases=["hi"])
async def hello(message: pyrevolt.Message, name: str) -> None:
await message.Send(content=f"Hello {name}!")
@hello.Error
async def helloError(message: pyrevolt.Message, error: Exception) -> None:
await message.Send(content=f"{str(error)}")

bot.Run(token="TOKEN")
```

As the library expands, more examples will be added, but we expect users during the very initial development phases to read through the source in order to find how to develop (this will of course change over the development of the library).
As the library expands, more examples will be added, but we expect users during the very initial development phases to read through the documentation and see how to use the library. If you have any questions, please join the support server and ask for help.

### Useful Information
#### Code Quality
[![CodeFactor](https://www.codefactor.io/repository/github/genericnerd/pyrevolt/badge)](https://www.codefactor.io/repository/github/genericnerd/pyrevolt)
[![CircleCI](https://circleci.com/gh/GenericNerd/pyrevolt.svg?style=shield)](https://app.circleci.com/pipelines/github/GenericNerd/pyrevolt)
[![StyleCI](https://github.styleci.io/repos/471419418/shield?branch=production)](https://github.styleci.io/repos/471419418?branch=production)
[![CodeFactor](https://www.codefactor.io/repository/github/pyrevolt/pyrevolt/badge)](https://www.codefactor.io/repository/github/pyrevolt/pyrevolt)
[![CircleCI](https://circleci.com/gh/pyrevolt/pyrevolt.svg?style=shield)](https://app.circleci.com/pipelines/github/pyrevolt/pyrevolt)
#### Repository Information
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/GenericNerd/pyrevolt.svg)](http://isitmaintained.com/project/GenericNerd/pyrevolt "Percentage of issues still open")
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Loading

0 comments on commit fd264ba

Please sign in to comment.