Giter VIP home page Giter VIP logo

swiftdiscord's Introduction

SwiftDiscord

Build Status

A Discord API client for Swift.

  • Features:
    • Sending and receiving voice.
    • macOS, iOS, and Linux** support.
    • Bot and User account support.
    • REST API separate from client. You can use the REST API separately to build your own client if you wish.
    • Configurable sharding.

** - Linux stability is currently limited to the stability of open source Foundation, but in thoery should support everything.

  • Requirements:

    • libopus
    • libsodium
    • Swift 3
  • Recommendend:

    • ffmpeg (Without FFmpeg you must send raw audio)
  • Installing and Building (Linux and macOS):

    • Install vapor dependencies:
      • brew tap vapor/tap && brew install ctls or eval "$(curl -sL https://apt.vapor.sh)"; sudo apt-get install vapor;
    • Create your Swift Package Manager project
    • Add .package(url: "https://github.com/nuclearace/SwiftDiscord", .upToNextMajor(from: "6.0.0")) to your dependencies in Package.swift
    • Add import SwiftDiscord to files you wish to use the module in.
    • Run swift build -Xlinker -L/usr/local/lib -Xlinker -lopus -Xcc -I/usr/local/include. The Xlinker options are needed to tell the package manager where to find the libsodium and opus libraries that were installed through Homebrew. The Xcc option tells clang where to find the headers for opus.

Xcode:

If you wish to use Xcode with your Swift Package Manager project, you can do swift package generate-xcodeproj. However after doing that, you'll have to make a change to SwiftDiscord's build settings. Just like when compiling from the command line, we have to tell Xcode where to find libsodium and libopus. This can be done by adding /usr/local/lib to the library search paths and /usr/local/include to the header search paths. This should be done for the SwiftDiscord and DiscordOpus targets. The DiscordOpus target also needs the -lopus option in "Other Linker Flags".

Usage

Checkout the getting started page for a quickstart guide.

Docs are generated with jazzy using the magical command:

jazzy --xcodebuild-arguments -project,SwiftDiscord.xcodeproj/,-scheme,SwiftDiscord-Package --documentation=UsageDocs/*.md --theme fullwidth --module SwiftDiscord

Must have setup an Xcode project

Why no CocoaPods?

I hate CocoaPods and the Swift Package Manager makes it easy to do system modules.

swiftdiscord's People

Contributors

nuclearace avatar tellowkrinkle avatar nexuist avatar stunner avatar neotron avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.