27 lines
648 B
Python
27 lines
648 B
Python
#!/usr/bin/python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import discord
|
|
from discord.ext import commands
|
|
import config
|
|
import random
|
|
|
|
TOKEN = config.token
|
|
ID = config.channel_id
|
|
|
|
intents = discord.Intents.all()
|
|
|
|
bot = commands.Bot(command_prefix='!', intents=intents)
|
|
|
|
@bot.command(name='sky', help='Shows the latest image from the All Sky Camera in Kiruna')
|
|
async def ASC(ctx):
|
|
num = random.randint(1,100000)
|
|
message = f'https://www.irf.se/alis/allsky/krn/latest.jpeg?{num}'
|
|
if ctx.channel.id != ID:
|
|
await ctx.send(f"Please keep this stuff in <#{ID}>")
|
|
return
|
|
else:
|
|
await ctx.send(message)
|
|
return
|
|
|
|
bot.run(TOKEN) |