Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- from core.api import api
- import time
- import requests
- import random
- TOKEN = ""
- client = commands.Bot(command_prefix='!s ')
- client.remove_command('help')
- @client.event
- async def on_ready():
- print("--------------" * 20)
- print('Eingeloggt als')
- print(client.user.name)
- print(client.user.id)
- print("--------------" * 20)
- @client.command()
- async def shop():
- apikey = 'ed70e21d-8107-4883-bbcb-994ae113ac0b'
- request = api.Shop(apikey)
- response = request.send()
- shop = response.data
- embed = discord.Embed(
- title="Fortnite-Shop vom **%s**" % time.strftime("%d.%m.%Y"),
- color=discord.Colour.orange(),
- description="The current item shop rotation for Fortnite Battle Royale - updates daily at 00:00 UTC."
- )
- for item in shop.daily:
- embed.add_field(
- name="Daily items:",
- value="\t{0}: {1} V-Bucks".format(item.name, item.price)
- )
- embed.add_field(
- name="------------",
- value="--" * 30
- )
- for item1 in shop.featured:
- embed.add_field(
- name="Featured items:",
- value="\t{0}: {1} V-Bucks".format(item1.name, item1.price)
- )
- embed.set_footer(
- text="Powerd by Young-Devs & fnbr.co API.",
- )
- embed.set_thumbnail(url='https://image.fnbr.co/price/icon_vip.png')
- await client.say(embed=embed)
- @client.command()
- async def state():
- baseURL = "https://fortnite-api.tresmos.xyz/status?key=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Inp1bmFtaWRldkBnbWFpbC5jb20iLCJ1c2VySWQiOiI1YmMxY2FhZWVlMzNjYTZjMGRmYjA1NGUifQ.kmW8e0jqdHsm1fbhjAhpbzRONiJa--3EBuLTrgaY9Pw"
- param = dict()
- resp = requests.get(url=baseURL, params=param)
- data = resp.json()
- if data["boolean"] == 1:
- status = discord.Embed(
- title="Server state",
- color=discord.Colour.green(),
- )
- status.add_field(
- name="Online",
- value="The Fortnite server are Online."
- )
- else:
- status = discord.Embed(
- title="Server state",
- color=0xFF0000
- )
- status.add_field(
- name="Offline",
- value="The Fortnite server are Offline."
- )
- await client.say(embed=status)
- @client.command()
- async def drop():
- statd = ["Salty Springs", "Dusty Divot", "Tomato Temple", "Lazy Links", "Junk Junction", "Haunted Hills",
- "Snobby Shores", "Greasy Grove", "Shifty Shafts", "Tilted Towers", "Leaky Lake", "Risky Reels",
- "Wailing Woods", "Lonely Lodge", "Paradise Palms", "Lucky Landing", "Fatal Fields", "Flush Factory",
- "Retail Row", "Pleasant Park"]
- ran = random.choice(statd)
- drop1 = discord.Embed(
- title="Drop",
- color=discord.Colour.orange(),
- )
- drop1.add_field(
- name=ran,
- value="Jump out of the bus"
- )
- drop1.set_footer(
- text="Powerd by Young-Devs & fnbr.co API.",
- )
- drop1.set_thumbnail(url='https://image.fnbr.co/price/icon_vip.png')
- await client.say(embed=drop1)
- @client.command(pass_context=True)
- async def help(ctx):
- author = ctx.message.author
- helpm = discord.Embed(
- color=discord.Colour.orange(),
- )
- helpm.set_author(name="Help")
- helpm.add_field(name='!s shop', value="Shows you the daily Shop")
- helpm.add_field(name='!s drop', value="Shows you a random Place in Fortnite")
- helpm.add_field(name='!s stae', value="Shows you the Fortnite-BR server state")
- helpm.add_field(name='!s help', value="Shows you the help menu")
- await client.send_message(author, embed=helpm)
- client.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement