Compare commits
8 Commits
9b034e8436
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e19ebf08a | |||
| 84d0447376 | |||
| a1b6e94e20 | |||
| 0ea6e64b44 | |||
| 54986c9ff0 | |||
| f7acbf2d20 | |||
| 5e51187199 | |||
| 55952c3ab4 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
config.py
|
config.py
|
||||||
|
__pycache__
|
||||||
|
nohup.out
|
||||||
|
|||||||
5
LICENSE
Normal file
5
LICENSE
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"THE NON-ALCOHOLIC-BEVERAGE-WARE LICENSE":
|
||||||
|
|
||||||
|
<arnau.busom@pm.me> wrote this. As long as you retain this notice you can
|
||||||
|
do whatever you want with this stuff. If we meet some day, and you think this
|
||||||
|
stuff is worth it, you can buy me a non-alcoholic beverage in return Arnau Busom
|
||||||
Binary file not shown.
33
auroraBot.py
33
auroraBot.py
@ -4,6 +4,8 @@
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import config
|
import config
|
||||||
|
import random
|
||||||
|
import requests
|
||||||
|
|
||||||
TOKEN = config.token
|
TOKEN = config.token
|
||||||
ID = config.channel_id
|
ID = config.channel_id
|
||||||
@ -14,9 +16,36 @@ bot = commands.Bot(command_prefix='!', intents=intents)
|
|||||||
|
|
||||||
@bot.command(name='sky', help='Shows the latest image from the All Sky Camera in Kiruna')
|
@bot.command(name='sky', help='Shows the latest image from the All Sky Camera in Kiruna')
|
||||||
async def ASC(ctx):
|
async def ASC(ctx):
|
||||||
message = 'https://www.irf.se/alis/allsky/krn/latest.jpeg'
|
num = random.randint(1,100000)
|
||||||
|
message = f'https://www.irf.se/alis/allsky/krn/latest.jpeg?{num}'
|
||||||
if ctx.channel.id != ID:
|
if ctx.channel.id != ID:
|
||||||
await ctx.send(f"Please keep this stuff in <{ID}>")
|
await ctx.send(f"Please keep this stuff in <#{ID}>")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
await ctx.send(message)
|
||||||
|
return
|
||||||
|
|
||||||
|
@bot.command(name='kp', help='Shows the current Kp index')
|
||||||
|
async def kp(ctx):
|
||||||
|
response = requests.get('https://services.swpc.noaa.gov/products/noaa-planetary-k-index.json')
|
||||||
|
data = response.json()
|
||||||
|
kp = data[-1][1]
|
||||||
|
message = f'The current Kp index is {kp}'
|
||||||
|
|
||||||
|
if ctx.channel.id != ID:
|
||||||
|
await ctx.send(f"Please keep this stuff in <#{ID}>")
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
await ctx.send(message)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@bot.command(name='solarWind', help='Shows graph with solar wind and magnetic field info')
|
||||||
|
async def ASC(ctx):
|
||||||
|
num = random.randint(1,100000)
|
||||||
|
message = f'https://www.spaceweather.se/content/irf-kp.png?{num}'
|
||||||
|
if ctx.channel.id != ID:
|
||||||
|
await ctx.send(f"Please keep this stuff in <#{ID}>")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
await ctx.send(message)
|
await ctx.send(message)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user