Compare commits

..

No commits in common. "main" and "9b034e8436c6c27a8940558ede06503b422f30c5" have entirely different histories.

4 changed files with 2 additions and 38 deletions

2
.gitignore vendored
View File

@ -1,3 +1 @@
config.py config.py
__pycache__
nohup.out

View File

@ -1,5 +0,0 @@
"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.

View File

@ -4,8 +4,6 @@
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
@ -16,36 +14,9 @@ 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):
num = random.randint(1,100000) message = 'https://www.irf.se/alis/allsky/krn/latest.jpeg'
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)