3
3
import subprocess
4
4
import datetime
5
5
import urllib .request , json
6
+ import requests
6
7
7
8
bot = commands .Bot (
8
9
irc_token = "oauth:" + os .environ ['tip' ],
@@ -26,14 +27,11 @@ async def event_message(message):
26
27
async def test_command (ctx ):
27
28
await ctx .send (f'Hello { ctx .author .name } ' )
28
29
29
- @bot .command (name = 'agenda' , aliases = ['c ' ])
30
+ @bot .command (name = 'agenda' , aliases = ['a ' ])
30
31
async def agenda_command (ctx ):
31
32
with urllib .request .urlopen ("https://raw.githubusercontent.com/hackbacc/schedule/master/json/schedule.json" ) as url :
32
33
data = json .loads (url .read ().decode ())
33
34
34
- # with open('json/schedule.json', 'r') as f:
35
- # data = json.load(f)
36
-
37
35
to_date = datetime .datetime .now ().date ()
38
36
agendas = []
39
37
@@ -47,4 +45,20 @@ async def agenda_command(ctx):
47
45
48
46
for agenda in agendas :
49
47
await ctx .send (agenda )#.encode('utf-8'))
48
+
49
+ @bot .command (name = 'discord' , aliases = ['d' ])
50
+ async def discord_command (ctx ):
51
+ await ctx .send ("https://discord.gg/9pQgEEx" )
52
+
53
+ @bot .command (name = 'github' , aliases = ['g' ])
54
+ async def github_command (ctx ):
55
+ await ctx .send ("Personal - https://github.com/markroxor" )
56
+ await ctx .send ("Channel - https://github.com/hackbacc" )
57
+
58
+ @bot .command (name = 'projects' , aliases = ['p' ])
59
+ async def projects_command (ctx ):
60
+ payload = requests .get ('https://api.github.com/users/hackbacc/repos' ).text
61
+ for project in json .loads (payload ):
62
+ await ctx .send (project ['full_name' ] + " - " + project ['html_url' ] + " - " + str (project ['description' ]))
63
+
50
64
bot .run ()
0 commit comments