Skip to content

Commit

Permalink
update bot
Browse files Browse the repository at this point in the history
  • Loading branch information
inada-s committed Jan 31, 2021
1 parent d0718bb commit 7498c90
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chatops/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@


@bot.command()
async def ping(ctx):
async def ping(ctx: commands.Context):
await ctx.send('pong')


@bot.command()
@commands.has_any_role("Moderator")
async def master(ctx: commands.Context):
await ctx.send("https://docs.google.com/spreadsheets/d/" + os.getenv("GDXSV_SPREADSHEET_ID"))


@bot.command()
@commands.has_any_role("Moderator")
async def master_up(ctx: commands.Context):
await ctx.send("Updating masterdata...")
try:
Expand All @@ -39,8 +41,7 @@ async def master_up(ctx: commands.Context):

req = urllib.request.Request("http://localhost:9880/ops/reload")
with urllib.request.urlopen(req) as res:
await ctx.send(body)

await ctx.send("Reload: " + res.read().decode('utf-8'))
await ctx.send("Done")


Expand Down

0 comments on commit 7498c90

Please sign in to comment.