thread watching
This commit is contained in:
parent
446b53db61
commit
c6a4f032fa
|
@ -1,5 +1,4 @@
|
|||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Various things related to Banished Quest.
|
||||
"""
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
This module exracts various information from imbd.
|
||||
It also contains functionality for the local movie database.
|
||||
|
@ -22,14 +21,14 @@ def setup(bot):
|
|||
@module.example('.movie Citizen Kane', '[MOVIE] Title: Citizen Kane | Year: \
|
||||
1941 | Rating: 8.4 | Genre: Drama, Mystery | IMDB Link: \
|
||||
http://imdb.com/title/tt0033467')
|
||||
def movie(bot, trigger):
|
||||
def movieInfo(bot, trigger):
|
||||
"""
|
||||
Returns some information about a movie, like Title, Year, Rating,
|
||||
Genre and IMDB Link.
|
||||
"""
|
||||
if not trigger.group(2):
|
||||
if not trigger.group().replace(".movie ", ""):
|
||||
return
|
||||
word = trigger.group(2).strip().replace(" ", "+")
|
||||
word = trigger.group().replace(".movie ", "").strip().replace(" ", "+")
|
||||
|
||||
api_key = bot.config.movie.tmdb_api_key
|
||||
uri = "https://api.themoviedb.org/3/search/movie?" + \
|
||||
|
@ -125,11 +124,15 @@ def pickMovie(bot, trigger):
|
|||
cur = conn.cursor()
|
||||
cur.execute("SELECT movie_title FROM movie WHERE " + \
|
||||
"times_watched < 1 AND shitpost = 0 ORDER BY RANDOM() LIMIT 1;")
|
||||
movie = cur.fetchone()
|
||||
movie = cur.fetchone()[0]
|
||||
conn.close()
|
||||
|
||||
bot.memory['movie_lock'].release()
|
||||
bot.reply(movie[0])
|
||||
bot.reply(movie)
|
||||
|
||||
if trigger.group(2) == "-m":
|
||||
trigger.set_group(f".movie {movie}")
|
||||
movieInfo(bot, trigger)
|
||||
|
||||
|
||||
@module.require_admin
|
||||
|
|
Loading…
Reference in New Issue
Block a user