Discord Chat Bot Asynchronous PHP Benjamin Hamilton Harris May 2, - - PowerPoint PPT Presentation

discord chat bot
SMART_READER_LITE
LIVE PREVIEW

Discord Chat Bot Asynchronous PHP Benjamin Hamilton Harris May 2, - - PowerPoint PPT Presentation

Discord Chat Bot Asynchronous PHP Benjamin Hamilton Harris May 2, 2017 Northern Michigan University Introduction Discord Discord Chat Client Marketed towards gamers Rich text chat Silky smooth voice chat 1 Discord API


slide-1
SLIDE 1

Discord Chat Bot

Asynchronous PHP

Benjamin Hamilton Harris May 2, 2017

Northern Michigan University

slide-2
SLIDE 2

Introduction

slide-3
SLIDE 3

Discord

Discord Chat Client

  • Marketed towards gamers
  • Rich text chat
  • Silky smooth voice chat

1

slide-4
SLIDE 4

Discord API

Discord exposes a REST-ful HTTP API

  • Raw HTTP requests are cumbersome
  • Many wrapper libraries available
  • JavaScript, Python most popular

2

slide-5
SLIDE 5

Project Info

slide-6
SLIDE 6

Technology Stack

Technologies

  • PHP 7
  • DiscordPHP API wrapper library
  • ReactPHP Promises for Async
  • Composer

3

slide-7
SLIDE 7

Project Background

Proposal

  • Started as passion project
  • General purpose chat bot
  • Rapidly growing feature set

4

slide-8
SLIDE 8

Grading

slide-9
SLIDE 9

Possible Points

  • Get User Info [1 pts]
  • Get Profile Photo for

arbitrary User [1 pts]

  • Get Server Info [2 pts]
  • Display Bot

Status/Uptime [1 pts]

  • Send direct message to

any user [1 pts]

  • Permissions for

commands based on user’s permissions [2 pts]

  • Talk to Cleverbot [3 pts]
  • Save images and retrieve

them later [5 pts]

  • Save text and retrieve it

later [2 pts]

  • Send me a text message

[2 pts]

  • Send emails to a saved

address for a user [2 pts]

5

slide-10
SLIDE 10

Possible Points, cont.

  • Internet lookups

– Weather for any city [3 pts] – Time for any city [3 pts] – Save a preferred city for each user for time and weather [2 pts] – Look up a random joke [2 pts] – Send an image from Google Images [5 pts] – Stream music from YouTube to voice channel [10 pts]

  • Create and vote on polls

[5 pts]

  • Chat games (TicTacToe,

Hangman) [10 pts]

  • Text transform (emojis,

unicode fonts, and ASCII art) [3 pts]

  • Roll an n-sided die [1 pts]
  • 8-Ball style fortunes [2

pts]

6

slide-11
SLIDE 11

Demo Time!

7

slide-12
SLIDE 12

Grading Scale

63+ → A 56+ → B 49+ → C 42+ → D 35+ → F 65/70 possible points from proposal achieved

8

slide-13
SLIDE 13

Possible Extra Points

Things I’ve done that might be worth more points!

  • Edit and delete messages in the chat
  • Run a command line process and return stdout as a

message

  • Evaluate arbitrary PHP code and return the results to the

chat

I am the only user allowed to evaluate arbitrary code.

9

slide-14
SLIDE 14

Any Questions?

10