-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from LanceMaverick/getbeard
New beard package manager! And more instructions for newbeard.py.
- Loading branch information
Showing
26 changed files
with
273 additions
and
195 deletions.
There are no files selected for viewing
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,4 +1,5 @@ | ||
# Custom | ||
beard_cache/* | ||
*.dbbin | ||
beards/*/config.yml | ||
config.py | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
This file is intentionally committed to git to keep the folder beard_cache in the repo. |
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,2 @@ | ||
{description: A dice module for skybeard (telepot), git_url: 'https://github.com/nasfarley88/dicebeard.git', | ||
name: dicebeard} |
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,3 @@ | ||
description: Browse github with telegram using skybeard-2. | ||
git_url: https://github.com/nasfarley88/githubbeard.git | ||
name: githubbeard |
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,3 @@ | ||
description: A beard to let people know things for skybeard-2 | ||
git_url: https://github.com/nasfarley88/letthemknowbeard.git | ||
name: letthemknowbeard |
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,3 @@ | ||
description: Makes lists for skybeard-2 | ||
git_url: https://github.com/nasfarley88/listbeard.git | ||
name: listbeard |
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,3 @@ | ||
description: null | ||
git_url: https://github.com/nasfarley88/namedvotebeard.git | ||
name: namedvotebeard |
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,3 @@ | ||
name: pdfpreviewbeard | ||
description: Shows a preview of the first page for any pdf sent to the chat. | ||
git_url: https://github.com/nasfarley88/pdfpreviewbeard.git |
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,3 @@ | ||
description: A beard that thanks users for skybeard-2. | ||
git_url: https://github.com/nasfarley88/thankyoubeard.git | ||
name: thankyoubeard |
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,3 @@ | ||
description: null | ||
git_url: https://github.com/nasfarley88/xkcdbeard.git | ||
name: xkcdbeard |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
A beard named repo_helper for skybeard-2. |
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,47 @@ | ||
from pygithub3 import Github | ||
import yaml | ||
|
||
from skybeard.beards import BeardChatHandler | ||
from skybeard.decorators import onerror | ||
from skybeard.utils import get_args | ||
|
||
|
||
class RepoHelper(BeardChatHandler): | ||
|
||
__userhelp__ = """Helps make yamls for beard repository.""" | ||
|
||
__commands__ = [ | ||
("makerepoyamlfromgithub", 'make_repo_yaml', | ||
'Makes yaml for repo based on github repo name.') | ||
] | ||
|
||
# __init__ is implicit | ||
|
||
@onerror | ||
async def make_repo_yaml(self, msg): | ||
args = get_args(msg) | ||
try: | ||
repo_name = args[0] | ||
except IndexError: | ||
await self.sender.sendMessage( | ||
"Please provide the full name of the repo.") | ||
resp = await self.listener.wait() | ||
repo_name = resp['text'] | ||
|
||
await self.sender.sendChatAction("upload_document") | ||
|
||
gh = Github() | ||
repo = gh.get_repo(repo_name) | ||
data = { | ||
"name": repo.name, | ||
"description": repo.description, | ||
"git_url": repo.clone_url | ||
} | ||
|
||
name = "{}.yml".format(data["name"]) | ||
encoded_data = yaml.dump(data, | ||
encoding="utf-8", | ||
default_flow_style=False) | ||
self.logger.debug("Yaml made:\n\n{}".format( | ||
encoded_data.decode('utf-8'))) | ||
await self.sender.sendDocument((name, encoded_data)) |
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 @@ | ||
pygithub3 |
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,5 @@ | ||
from skybeard.utils import setup_beard | ||
|
||
setup_beard( | ||
"repo_helper", | ||
) |
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
Oops, something went wrong.