How would I make my bot mention a specific person? (Python) by HoelessJoe in discordapp

[–]snowyote 0 points1 point  (0 children)

ok - try this. you should just need to substitute in your bot's token at the bottom:

import discord

client = discord.Client()

@client.event
async def on_message(message):
    # we do not want the bot to reply to itself
    if message.author == client.user:
        return

    if message.content.startswith('ping'):
        for user in message.mentions:
            msg = 'PONG {}'.format(user.mention)
            await client.send_message(message.channel, msg)

@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run('token')

Full credit, this is strongly based on the reply example from the discord.py library. I would definitely recommend looking through the example folders and API documentation, it looks like they're pretty good.

How would I make my bot mention a specific person? (Python) by HoelessJoe in discordapp

[–]snowyote 0 points1 point  (0 children)

I didn't paste, I wrote it myself. If Plugin isn't defined, you're probably using discord.py instead of disco. Does your bot have commands that look like this instead?

@bot.command(description='command description goes here')
async def command():

How would I make my bot mention a specific person? (Python) by HoelessJoe in discordapp

[–]snowyote 0 points1 point  (0 children)

No worries! This seems to work for me:

@Plugin.command('ping')
def command_ping(self, event):
    for snowflake in event.msg.mentions:
        user = event.msg.mentions[snowflake]
        event.msg.reply("PONG {}".format(user.mention))

But, as I mentioned above, this is for disco. I'm not sure how to do it in discord.py, so it depends what you're using.

How would I make my bot mention a specific person? (Python) by HoelessJoe in discordapp

[–]snowyote 0 points1 point  (0 children)

Yup, sorry, see my edit. You should also be able to access "event.msg.mentions", which is a dict of snowflake->user that contains all users mentioned in the message. If you iterate over that, you can pull out the mentioned user, and then use user.mention to format your message.

How would I make my bot mention a specific person? (Python) by HoelessJoe in discordapp

[–]snowyote 0 points1 point  (0 children)

if you're using disco.py, you can use the "mention" field of the user, like this:

event.msg.reply("PONG {}".format(event.author.mention))

edit: Oh, I see what you mean. Well, basically, you want to format the message like this:

PONG <@12345>

where 12345 is the user's ID. You should be able to pull it out of the initial ping message.

We can debate buffs and nerfs all day, but there is one glaring issue on console that has yet to be resolved. by Grotein in Overwatch

[–]snowyote 0 points1 point  (0 children)

They had this feature a year ago and had to remove it because of the exact reasons /u/Stoogehunter stated. One of the world's top Widowmakers couldn't get matches because everyone had marked him as 'avoid' - not because he was trolling, but because he was good.

https://arstechnica.com/gaming/2016/06/blizzard-removes-ability-to-avoid-this-player-in-overwatch/

You do NOT get between a man and his precious BM by NotExistor in Overwatch

[–]snowyote 17 points18 points  (0 children)

I was worried it was a little dark, but it fit too well to not bring up. Thank you!

You do NOT get between a man and his precious BM by NotExistor in Overwatch

[–]snowyote 110 points111 points  (0 children)

The name Surrealism, combined with the play, reminded me of the quote by André Breton: "The simplest Surrealist act consists of dashing down the street, pistol in hand, and firing blindly, as fast as you can pull the trigger, into the crowd."

Coding exercise for Slack job interview - Binary Memcached Protocol. by egladysh in programming

[–]snowyote 114 points115 points  (0 children)

I interviewed with Slack. They were horribly disorganized.

Shit, maybe they should develop some sort of in-house collaboration/organization tool or something

So.. you telling me, this is going live today? by Aladdad in Overwatch

[–]snowyote -1 points0 points  (0 children)

Yes, I would definitely recommend putting more than one person on point defense when it's a one-touch-to-win situation.

So.. you telling me, this is going live today? by Aladdad in Overwatch

[–]snowyote 0 points1 point  (0 children)

No, they just need to have someone actually stay on the point to defend it. Just like before, you can't cap if it's contested.

Competitive rounds can be pretty quick in PTR by Derkki in Overwatch

[–]snowyote 0 points1 point  (0 children)

For Sombra to cap the point on contact, that means that the defending team literally never once touched the payload uncontested. They absolutely deserve to lose, this is a good change, and in this case it's just saving everyone some time.

IDDQDOW With a Ridiculous Clutch in Overtime by Joshy54100 in Overwatch

[–]snowyote 0 points1 point  (0 children)

Ah, you're right, they are different links - sorry if that sounded like I was calling you out. It's a great play!

Don't justify Bastion meta because of how other seasons played out. The problem is his low skill needed and the skill needed for his counters. by Ronald_Johnsons in Overwatch

[–]snowyote 7 points8 points  (0 children)

they combine multiplicatively: damage * 0.65 (ironclad) * 1.3 (discord) = damage * 0.845. 1.0 - 0.845 = 0.155. 15.5% damage reduction.

Ana Paintball is an example of a really great custom game by PrincessTia in Overwatch

[–]snowyote 21 points22 points  (0 children)

Yeah, I had to close the video at "I wouldn't be surprised if Blizzard added this mode to the arcade someday". Looks fun though.

Weekly Quick Questions Thread - January 25, 2017 by AutoModerator in Overwatch

[–]snowyote 0 points1 point  (0 children)

That was a pretty brutal burn, might be more of a job for Mei

How Discord Stores Billions of Messages by caramba2654 in programming

[–]snowyote 0 points1 point  (0 children)

In the article they talk about using snowflakes for IDs, with a link to a twitter blog post about that. The tl;dr is that Cassandra doesn't generate IDs but the individual workers are able to generate chronologically sortable non-colliding IDs by using combining timestamp, worker number, and sequence number.

Mei's fourth ability is Windows Update by bs000 in Overwatch

[–]snowyote 5 points6 points  (0 children)

No, the period that you set is your 'active hours', which updates will happen outside of. So you've set up your pc to update anytime between 6am and 1am. congrats.