Exemple #1
0
 def __init__(self, bot):
     self.bot = bot
     self.reddit = apraw.Reddit(username=REDDIT_USERNAME,
                                client_secret=REDDIT_SECRET,
                                password=REDDIT_PASSWORD,
                                user_agent=REDDIT_USERAGENT,
                                client_id=REDDIT_ID)
Exemple #2
0
 def __init__(self, **options):
     super().__init__(
         "!",
         description="The official Reddify bot by Dan6erbond to seamlessly connect Reddit and Discord.",
         help_command=HelpCommand(),
         intents=intents,
         **options)
     self.reddit = apraw.Reddit("TRB")
Exemple #3
0
def reddit():
    import apraw

    reddit = apraw.Reddit(client_id=client_id,
                          client_secret=client_secret,
                          password=password,
                          username=username)
    return reddit
Exemple #4
0
 async def initialize(self) -> None:
     await self.bot.wait_until_red_ready()
     keys = await self.bot.get_shared_api_tokens("reddit")
     if not keys:
         return
     try:
         self.login = apraw.Reddit(
             client_id=keys["client_id"],
             client_secret=keys["client_secret"],
             password=keys["password"],
             username=keys["username"],
             user_agent=f"Trusty-cogs/{self.__version__} on {self.bot.user}",
         )
         log.debug("Logged into Reddit.")
         self.subreddits = await self.config.subreddits()
         self._ready.set()
     except KeyError:
         log.error(
             "You have not provided all the correct information I need to login to reddit."
         )
     except Exception:
         log.exception("Error logging into Reddit.")
Exemple #5
0
 async def initialize(self):
     await self.bot.wait_until_red_ready()
     keys = await self.bot.get_shared_api_tokens("reddit")
     if not keys:
         return
     try:
         self.login = apraw.Reddit(
             client_id=keys["client_id"],
             client_secret=keys["client_secret"],
             password=keys["password"],
             username=keys["username"],
             user_agent=f"TrustyCogs/{self.__version__} on {self.bot.user}",
         )
         log.debug("Logged into Reddit.")
     except Exception:
         log.exception("Error logging into Reddit.")
     if self.login:
         self.subreddits = await self.config.subreddits()
         for sub, data in self.subreddits.items():
             if sub not in self._streams:
                 subreddit = await self.login.subreddit(data["name"])
                 self._streams[sub] = self.bot.loop.create_task(
                     self._run_subreddit_stream(subreddit))
 def __init__(self, bot):
     self.bot = bot
     username, password, client_secret, client_id = load_reddit_creds()
     self.bot.reddit = apraw.Reddit(username=username, password=password, client_secret=client_secret, client_id=client_id)
     self.aww_submissions = []
     self.bot.good = [224323277370294275, 448250281097035777, 562642634686988289, 368880176970596352]
Exemple #7
0
import asyncio
import random


def loadFile(file):
    f = open(file)
    content = []
    for line in f.readlines():
        content.append(line.strip())
    return content


load_dotenv()
reddit = apraw.Reddit(client_id=os.getenv("REDDIT_ID"),
                      client_secret=os.getenv("REDDIT_SECRET"),
                      username=os.getenv("REDDIT_NAME"),
                      password=os.getenv("REDDIT_PASS"),
                      user_agent="effectbot")
quotes = []
quotes = loadFile("quotes.txt")


class Chat(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command(name="meme", help="displays funny meme from Reddit"
                      )  #meme module with Praw
    async def meme(self, ctx, subred="memes"):
        async with ctx.typing():
            sub = await reddit.subreddit(subred)  #TODO fix weird subreddit bug
import discord
import gspread
import praw
from discord.ext import commands
from oauth2client.service_account import ServiceAccountCredentials

import apraw
import uslapi

REGGIE_COLOR = discord.Colour(0).from_rgb(152, 0, 0)
GIFTS_PER_CHILD = 4

bot = commands.Bot("!", description="SCW's registration bot 🤓.")

aReddit = apraw.Reddit("RB")
reddit = praw.Reddit("RB")

usl = uslapi.UniversalScammerList('bot for SCW by /u/SantasChristmasWish')
usl_user = usl.login('SantasChristmasWish', 'Harvey98')

approvers = [
    592816167190790160, 592803234368716801, 495503769451102210,
    597803503951544320, 383657174674702346
]  # remove the last one before release, find out who 598159671651729409 is


@bot.event
async def on_ready():
    print(str(bot.user) + ' is running.')
import firebase
import stats
from cmds import HelpCommand
from config import config as lc_config
from helpers import MessageBuilder

logger = logging.getLogger("banhammer")

formatter = logging.Formatter(u'%(asctime)s - %(name)s - %(levelname)s - %(message)s')

fileHandle = logging.FileHandler('banhammer.log')
fileHandle.setFormatter(formatter)
fileHandle.setLevel(logging.WARNING)
logger.addHandler(fileHandle)

reddit = apraw.Reddit("LCB")
gta_green = discord.Colour(0).from_rgb(207, 226, 206)

intents = discord.Intents.default()
intents.members = True


class LesterCrest(Bot, Banhammer):
    def __init__(self, **options):
        super().__init__(lc_config["command_prefix"], help_command=HelpCommand(gta_green),
                         description="/r/gtaonline's moderation bot using Banhammer.py.", intents=intents,
                         **options)
        Banhammer.__init__(self, reddit, bot=self, embed_color=gta_green, message_builder=MessageBuilder(),
                           change_presence=lc_config["change_presence"])

        self._new_ids = BoundedSet(301)
Exemple #10
0
import asyncio
import configparser
from datetime import datetime

import apraw
import banhammer
import discord
from banhammer import Banhammer
from banhammer.models import EventHandler, ItemAttribute, RedditItem, Subreddit
from discord.ext import commands
from discord.ext.commands import Bot

from config import config as bh_config

reddit = apraw.Reddit("TBHB")


class Banhacker(Bot, Banhammer):
    def __init__(self, **options):
        super().__init__(
            bh_config["command_prefix"],
            description=
            "The Banhacker bot built for Discord's Hack-Week based on the Banhammer framework.",
            **options)
        Banhammer.__init__(self,
                           reddit,
                           bot=self,
                           change_presence=bh_config["change_presence"])

    @property
    def embed(self):