You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.
Sketch edited this page Jun 26, 2022
·
2 revisions
Welcome to the Swiftcord wiki!
Swiftcord is a wrapper for Discord's Bot API. It aims to be clean and simple as possible.
Here you can find examples on how to use the many features Swiftcord provides.
If you would like to contribute to the wiki, contact Sketch#4374 on Discord.
Basic Message Listener
import Swiftcord
letbot=Swiftcord(token:"Your bot token here")
// Set activity if wanted
letactivity=Activities(name:"with Swiftcord!", type:.playing)
bot.editStatus(status:.online, activity: activity)
// Set intents which are required for listening to messages
bot.setIntents(intents:.guildMessages)classMyBot:ListenerAdapter{overridefunc onMessageCreate(event:Message)async{
if msg.content =="!ping"{try!await msg.reply(with:"Pong!")}}}
bot.addListeners(MyBot())
bot.connect()