Skip to content

Commit 6cf2536

Browse files
committed
more cmds
1 parent fb6d0e3 commit 6cf2536

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

bot.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ async def github_command(ctx):
5959
async def projects_command(ctx):
6060
payload = requests.get('https://api.github.com/users/hackbacc/repos').text
6161
for project in json.loads(payload):
62-
await ctx.send(project['full_name'] + " - " + project['html_url'] + " - " + str(project['description']))
62+
await ctx.send(project['full_name'] + " -\n " + project['html_url'] + " - " + str(project['description']))
6363

64+
@bot.command(name='cmds', aliases=['c'])
65+
async def cmds_command(ctx):
66+
cmds = []
67+
for f in funcs:
68+
if f.endswith('_command'):
69+
cmds.append("!"+f.split('_')[0])
70+
await ctx.send('available cmds are - ' + ' '.join(cmds))
71+
72+
funcs = locals().keys()
6473
bot.run()

webhook.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ def do_POST(self):
2424

2525
body = json.loads(body)
2626
if body['repository']['full_name'] == 'hackbacc/hackbot':
27+
print('reset')
2728
pass
2829

2930
self.wfile.write(response.getvalue())
3031

3132

32-
httpd = HTTPServer(('localhost', 6006), SimpleHTTPRequestHandler)
33+
# httpd = HTTPServer(('localhost', 6006), SimpleHTTPRequestHandler)
34+
httpd = HTTPServer(('0.0.0.0', 6006), SimpleHTTPRequestHandler)
3335
httpd.serve_forever()
3436

0 commit comments

Comments
 (0)