HypeBot is the perfect way to add more #Hype to your chat application. Simply add this bot to get #Hype.
Want to increase #HypeQuality? Join https://discord.gg/QZmQd5m to get started.
Use bazel for building all the things. Installation instructions.
bazel build hypebot:lolbot.par --python_path=python3
./bazel-bin/hypebot/lolbot.par \
--params='{
"interface": {"token": "[DISCORD_TOKEN]"},
"riot": {"api_key": "[RIOT_KEY]"},
"commands": {"WeatherCommand": {"apixu_key": [APIXU_KEY]}
}'
Discord is our primary chat application interface. Create an application with Discord. Once the application is created, click "Create A Bot User" to get a Discord Token. You then need admin privileges on a server and select "Generate OAuth2 URL" to invite the bot to your server.
HypeBot gets its weather from www.apixu.com. Sign up to get your key.
By default, HypeBot looks for a Redis server running on localhost at the default port 6379. You can pass overrides in --params to use a different location.
To integrate with the Riot API, you need to create an application in order to get an API Key.
HypeBot is joining the 21st century and attempting to use a new fancy type annotation or hinting library to reduce the number of bugs that careless humans introduce into the otherwise spotless codebase. As you modify existing code or add new functionality, please use typing. Since we only support python3, this can be done in two easy steps.
Add the relevant imports from the typing
module into your python file
depending on the types used in your code.
from typing import Any, Callable
Add type annotations to your function definitions. As an example:
def DisableSkynet(requesting_user, confirmation_id,
post_disable_fn, are_you_really_sure=False):
...
# This turns into...
def DisableSkynet(requesting_user: str, confirmation_id: int,
post_disable_fn: Callable[..., None]
are_you_really_sure: bool = False) -> None:
...
Note: The ellipse inside Callable mean that post_disable_fn
can take any
number of arguments. If you want to annotate the function's arguments, use
the Callable[[int, str], None]
format.
A few "best" practices:
hypebot
) can
be omitted or replaced with Any
Because of how HypeParams
operates (specifically, creating attributes
dynamically from the initialization dict), typing can't provide useful
type-checking to these objects. If you need to annotate a HypeParams
instance,
just use Any
as per the best practices above.
Hypebot is not an official Google product.