Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 4th, 2020 148 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os
  2. import discord
  3. from dotenv import load_dotenv
  4. import tweepy
  5.  
  6.  
  7. class MyStreamListener(tweepy.StreamListener):
  8.     def on_status(self, status):
  9.         print(status.text)
  10.  
  11.  
  12. load_dotenv()
  13. TOKEN = os.getenv('DISCORD_TOKEN')
  14. GUILD = os.getenv('DISCORD_GUILD')
  15. client = discord.Client()
  16.  
  17. consumer_token = os.getenv("consumer_token")
  18. consumer_secret = os.getenv("consumer_secret")
  19.  
  20.  
  21. auth = tweepy.AppAuthHandler(consumer_token, consumer_secret)
  22. api = tweepy.API(auth)
  23.  
  24. #myStreamListener = MyStreamListener()
  25. #myStream = tweepy.Stream(auth=api.auth, listener=myStreamListener())
  26.  
  27.  
  28. @client.event
  29. async def on_ready():
  30.     for guild in client.guilds:
  31.         if guild.name == GUILD:
  32.             break
  33.     print(
  34.         f'{client.user} is connected to the following guild:\n'
  35.         f'{guild.name}(id: {guild.id})'
  36.     )
  37.     members = '\n - '.join([member.name for member in guild.members])
  38.     print(f'Guild Members:\n - {members}')
  39.  
  40.  
  41. @client.event
  42. async def on_message(message):
  43.     if message.content.find("!test") != -1:
  44.         for tweet in tweepy.Cursor(api.search, q='tweepy').items(1):
  45.             await message.channel.send(tweet.text)
  46.  
  47. client.run(TOKEN)
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