· 5 years ago · Nov 13, 2020, 06:56 PM
1# fuck every word discord bot
2
3# ADD A STOP COMMAND
4# MAKE IT SO YOU CAN ONLY RUN THE !f start COMMAND ONLY ONCE
5# SET PERMS
6# MAKE A "WELCOME MESSAGE" WHEN BOT JOINS SERVER
7
8# import
9import time
10import tweepy
11import discord
12import asyncio
13from discord.ext import commands
14import nest_asyncio
15import os
16import pandas as pd
17
18print("[INFO][*] Starting, [10%] [IMPORT LOADED]")
19
20# auth // discord setup
21consumer_key = "super secret key"
22consumer_secret = "super secret key"
23access_token = "super secret key"
24access_token_secret = "super secret key"
25
26auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
27auth.set_access_token(access_token, access_token_secret)
28
29nest_asyncio.apply()
30client = commands.Bot(command_prefix = '!f ')
31
32print("[INFO][+] Starting, [20%] [AUTH COMPLETED]")
33
34# info // helpmenu
35@client.command()
36async def helpmenu(ctx):
37 await ctx.send("""```
38 -----------Welcome to the Fuck Every Word discord bot (FEW) helpmenu-----------
39
40 Commands and examples:
41
42 start (example: !f start) Will start reading and posting all new tweets
43
44 stop (example: !f stop) Will stop reading and posting all new tweets
45
46 followers (example: !f followers) Will display the follower count
47
48 helpmenu (example: !f helpmenu) Will display the helpmenu
49
50 version (example: !f version) Will display the version of the bot
51
52 -------------------------------------------------------------------------------
53 ```""")
54
55print("[INFO][*] Starting, [30%] [HELPMENU LOADED]")
56
57# version
58
59@client.command()
60async def version(ctx):
61 await ctx.send("Fuck Every Word discord bot (FEW) version: 0.8")
62
63print("[INFO][*] Starting, [40%] [VERSION LOADED]")
64
65# tweets // scraper // embed // post
66
67@client.command()
68async def start(ctx):
69 await ctx.send("FEW Discord & Twitter bot starting now!")
70 for _ in range(99999999999):
71 api = tweepy.API(auth)
72 count = 1
73 username = "fckeveryword"
74 tweets = tweepy.Cursor(api.user_timeline,id=username).items(count)
75
76 tweets_list = [tweet.text for tweet in tweets]
77 newtweet = " ".join(tweets_list)
78
79 TwitterEmbed = discord.Embed(title='New Tweet:', description=newtweet, color=0x90EE90)
80 TwitterEmbed.set_author(name='Fuck Every Word')
81 await ctx.send(embed = TwitterEmbed)
82
83 await asyncio.sleep(2000)
84
85# stop
86
87print("[INFO][*] Starting, [70%] [SCRAPER LOADED]")
88# followers
89
90@client.command()
91async def setup(ctx):
92 guild = ctx.message.guild
93 await guild.create_text_channel('fuck-every-word')
94
95
96print("[INFO][*] Starting, [80%] [SETUP LOADED]")
97
98@client.command()
99async def followers(ctx):
100 api = tweepy.API(auth)
101 user = api.get_user('fckeveryword')
102 followers = user.followers_count
103 TwitterEmbed = discord.Embed(title='Followers:', description=followers, color=0x90EE90)
104 TwitterEmbed.set_author(name='Fuck Every Word')
105 await ctx.send(embed = TwitterEmbed)
106
107print("[INFO][+] Starting, [100%] Bot is up/running with no errors! [FOLLOWERS LOADED]")
108print("[INFO][*] Press CTRL + Z to shut the bot down!")
109client.run('super secret key')
110