filmaster modules

Discord bot that scours TMDB for film info.

filmaster.bot module

Discord bot module.

filmaster.bot.client = <discord.client.Client object>

The bot client instance.

filmaster.bot.PREFIX = '$'

The command prefix of the bot.

class filmaster.bot.FilmEmbed(**kwargs)[source]

Bases: discord.embeds.Embed

A Discord Embed made specifically for films.

classmethod from_film(film: filmaster.tmdb.Film, *, cast: bool = False) → filmaster.bot.FilmEmbed[source]

Create a new embed given a film object.

Parameters
  • film – The film to generate the embed from.

  • cast – Whether the embed should show the cast of the film.

Returns

An instance of the class.

filmaster.nlu module

Snips NLU engine module.

filmaster.nlu.engine = <snips_nlu.nlu_engine.nlu_engine.SnipsNLUEngine object>

The trained NLU engine of the bot.

filmaster.nlu.responses = {'goodbye': 'See you later!', 'greeting': 'Hello! What would you like to do?', 'help': 'I can find the details or cast of films. Most of the time...\nGo here for examples: https://gitlab.com/ObserverOfTime/filmaster#examples'}

Predefined responses to some basic intents.

filmaster.tmdb module

TMDB API module.

filmaster.tmdb.TMDB_URL = 'https://themoviedb.org'

The TMDB website URL.

exception filmaster.tmdb.ApiError[source]

Bases: Exception

An exception raised after receiving a blank response.

class filmaster.tmdb.Person[source]

Bases: tuple

A class representing a person (director or actor) entity.

property name

The name of the person.

property url

The URL of the person on TMDB.

property role

The role of the person.

classmethod from_args(*args) → Optional[filmaster.tmdb.Person][source]

Create a Person object from the given arguments.

Parameters

args – The role, name, and ID of the person.

Returns

An instance of the class.

__str__() → str[source]

Return a string representation of the object.

Returns

The name/URL of the person as a markdown link.

class filmaster.tmdb.Film[source]

Bases: tuple

A class representing a film entity.

property title

The title of the film.

property url

The URL of the film.

property thumbnail

The thumbnail URL of the film.

property description

The description of the film.

property tagline

The tagline of the film.

property language

The original language of the film.

property year

The year the film was released.

property runtime

The runtime of the film.

property score

The average score of the film.

property genres

The genres of the film.

property writer

The writer of the film.

property director

The director of the film.

property cast

The cast of the film.

filmaster.tmdb.get_film(*, film: Optional[str] = None, director: Optional[str] = None, actor: Optional[str] = None, year: Union[str, SupportsInt, None] = None) → filmaster.tmdb.Film[source]

Get the info of a film given a query.

Parameters
  • film – The title of the film.

  • director – The director of the film.

  • actor – An actor playing in the film.

  • year – The year of the film. Only used when film is also given.

Raises
Returns

A class containing the film’s info.

filmaster.tmdb.get_cast(*, film: str, year: Union[str, SupportsInt, None] = None) → filmaster.tmdb.Film[source]

Get the cast of a film by the title.

Parameters
  • film – The title of the film.

  • year – The year of the film. Only used when film is also given.

Raises
Returns

A class containing the film’s cast.

filmaster.tmdb.get_random() → str[source]

Get a random film about artificial intelligence.

Returns

The English title & year of the film.