daily pastebin goal
49%
SHARE
TWEET

swag bot

a guest Jun 14th, 2018 64 in 5 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -=- Resolve FAI Discord Bot Test -=- #
  2.  
  3. import discord
  4. from discord.ext import commands
  5. import asyncio
  6. import time
  7. import socket
  8.  
  9. nb = time.gmtime()
  10.  
  11. print("")
  12. years = nb[0]
  13. mounth = nb[1]
  14. day = nb[2]
  15. hours = nb[3]
  16. hours = int(hours)
  17. hours = hours + 2
  18. minute = nb[4]
  19. secound = nb[5]
  20. date = " " + str(day) + "/" + str(mounth) + "/" + str(years)
  21. temps = str(hours) + ":" + str(minute) + ":" + str(secound)
  22.  
  23. client = discord.Client()
  24. client = commands.Bot
  25.  
  26. @client.event
  27. async def on_ready():
  28.     print("Bot connected...\n")
  29.     print("Session" + date)
  30.     print("# " + temps + " #\n")
  31.  
  32. @client.event
  33. async def on_message(message) :
  34.  
  35.     if message.content[0] == "." :
  36.         if message.content[1] == "F" :
  37.             if message.content[2] == "A" :
  38.                 if message.content[3] == "I" :
  39.                     if message.content[4] == " " :
  40.                         print(".FAI")
  41.                         size = len(message.content)
  42.                         size = int(size)
  43.                         fo = size + 1
  44.                         ip = ""
  45.  
  46.                         for i in range (5,size) :
  47.  
  48.                             ip = ip + str(message.content[i])
  49.                             ip = str(ip)
  50.  
  51.                         try :
  52.  
  53.                             addr = socket.gethostbyaddr(ip)
  54.                             print("Addr scan done on : " + addr + " ~ " + str(message.author))
  55.  
  56.                         except :
  57.  
  58.                             addr = "FAI not found."
  59.                             print("Addr scan failed on : " + ip + " ~ " + str(message.author)
  60.  
  61.                         await client.send_message(message.channel,"{0}".format(addr))
  62.  
  63.     if message.content == ".list" :
  64.  
  65.         await client.send_message(channel.message,
  66.         "\nbbox.fr            :   Bouygues Telecom\n" +
  67.         "proxad.net         :   Free\n" +
  68.         "wanadoo.fr         :   Orange\n" +
  69.         "sfr.net            :   SFR\n" +
  70.         "cust.swisscom.ch   :   Swisscom (Suisse)\n" +
  71.         "voo.be             :   Voo (Belge)\n" +
  72.         "Belgacom.be        :   Belgacom (belge)\n" +
  73.         "numericable.fr     :   Numericable\n" +
  74.         "coucou-networks.fr :   Free (4g)\n" +
  75.         "aruba.it           :   Aruba (Italien)\n" +
  76.         "coditel.net        :   Coditel (Numericable Belge)\n")
  77.         print("FAI List command ~ " + str(message.author))
  78.  
  79. client.run("")
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