Skip to content

Instantly share code, notes, and snippets.

View JacobTyrrell's full-sized avatar
🌴
On vacation

Jacob Tyrrell JacobTyrrell

🌴
On vacation
  • United Kingdom
  • 00:15 (UTC +01:00)
View GitHub Profile
{
"contributors": [],
"translator": "jacob#5418",
"completion": "completed",
"code": "fr_FR",
"flag": ":flag_fr:",
"full": "Françias (FR)",
"strings": {
"global": {
"invalidFlag": {

Keybase proof

I hereby claim:

  • I am jacobtyrrell on github.
  • I am jacobtyrrell (https://keybase.io/jacobtyrrell) on keybase.
  • I have a public key ASC3xJv4kfkVU0Q_25GBRLKlFVAQNXZZ7-y1Np7MP3EDpAo

To claim this, I am signing this object:

import Foundation
import Sword
class SpamFilteringClass: Shield {
var messageCache = [Snowflake: [Snowflake: [Message]]]()
}
extension User: Equatable {
public static func ==(lhs: User, rhs: User) -> Bool {
return lhs.id == rhs.id
extension Shield {
func addMuteCmd() {
self.register("mute", with: muteMeta) { msg, args in
// Function
var em = Embed.init()
em.title = "Mute"
// Check that the caller has the appropriate permissions
guard let member = msg.member, member.hasPermission(.manageMessages) else {
em.description = "Sorry, you don't have the required permission: `MANAGE_ROLES`";
import Sword
var muteMeta = CommandOptions(
aliases: ["silence"],
description: "Mutes the member from chatting")
extension Shield {
func addMuteCmd() {
self.register("mute", with: muteMeta) { msg, args in
// Function
// Permission check
if msg.member!.hasPermission(Permission.manageMessages) {
// Check if args were provided
if !args.isEmpty {
// Grab the User struct for the targeted user
if let targetUser = msg.mentions.first {
// Drop the mention from the args
let newArgs = args.dropFirst()
let reason = newArgs.joined(separator: " ")
// Actually mute the User
// Prepare URL
let url = URL(string: "https://jsonplaceholder.typicode.com/todos")
guard let requestUrl = url else { fatalError() }
// Prepare URL Request Object
var request = URLRequest(url: requestUrl)
request.httpMethod = "POST"
// HTTP Request Parameters which will be sent in HTTP Request Body
let postString = "userId=300&title=My urgent task&completed=false";
// Set HTTP Request Body

Keybase proof

I hereby claim:

  • I am jacobtyrrell on github.
  • I am jacobtyrrell18 (https://keybase.io/jacobtyrrell18) on keybase.
  • I have a public key ASBixipS-a9mNAPqRkNx03SqnWoVzczG_AC3DglPBKHfHAo

To claim this, I am signing this object:

const Discord = require("discord.js");
const ms = require("ms");
const utils= require("../utils.js");
exports.run = async (client, message, args) => {
if (!message.guild.member.hasPermission("MANAGE_MESSAGES")) {
message.channel.send(":mute: | mute\nSorry but you do not have valid permissions.")
};
let tomute = message.guild.member(message.mentions.users.first();
if (!tomute) {
message.channel.send(":mute: | mute\nCould not find user.")
{
"room": "Aqua Tracks - Variety Music",
"author": "Jake",
"icon": "https://cdn.radiant.dj/rcs/icons/radiant/logo.png",
"css": "https://cdn.radiant.dj/rcs/rs_room.css",
"rules": {
"allowAutorespond": true,
"allowAutowoot": true,
"allowAutojoin": false,
"allowAutograb": true,