daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Aug 20th, 2018 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import discord
  2. from discord.ext.commands import Bot
  3. from discord.ext import commands
  4. import asyncio
  5. import pymysql
  6. bot = commands.Bot(command_prefix = "!s")
  7. @bot.event
  8. async def on_ready():
  9.     print("Bot zostal uruchomiony")
  10.     await bot.change_presence(game=discord.Game(name="sdfdsfsdfsdfds"))
  11. @bot.command(pass_context=True)
  12. async def pr(ctx,user):    
  13.             db = pymysql.connect(host="sdfsdfsdfl",user="jasdfsdfsdfr",password="Xsdfsdfds9",db="jsdfsdfsdfsdf")
  14.             print("Wywolanie komendy !spr z parametrem: {}".format(user))
  15.             cursor = db.cursor()
  16.             sql = "SELECT * from `punkty` WHERE `nick` = %s"
  17.             cursor.execute(sql,(user))
  18.             result = cursor.fetchone()
  19.             await bot.delete_message(ctx.message)
  20.             embed = discord.Embed(title = 'sdfsdf: '+user,discription = '',color = 0x42f456)
  21.             embed.add_field(name="sdfsdf: ",value = result[10],inline = False)
  22.             embed.add_field(name="sfdfsdfsd",value = result[3],inline = True)
  23.             embed.add_field(name="Pusdfdsfds",value = result[4],inline = True)
  24.             await bot.say(embed = embed)
  25.             db.close()
  26. @bot.command(pass_context=True)
  27. async def trona(ctx):
  28.     await bot.delete_message(ctx.message)
  29.     await bot.say("dsfdsfsdfsdfsdf")
  30.     print("Wywolanie komendy !strona")
  31. @pr.error
  32. async def pr_error(error, ctx):
  33.     await bot.delete_message(ctx.message)
  34.     emb = discord.Embed(title = '',discription = '',color = 0xd12323)
  35.     emb.add_field(name="Błąd!",value = "Wpisz !spr [Nick], lub upewnij się, że taki nick istnieje w bazie!",inline = True)
  36.     await bot.say(embed = emb)
  37.     print("Wystapil wyjatek komendy: !spr")
  38.  
  39. bot.run("sdfdsfsdfsdfsdf")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top