<pre name="code" class="python"> if($msg->type eq "friend_message"){# Received a friend message 
$sender = $msg->sender; # Get the friend object
$friend=$sender->displayname;
# print " My good friend :" . $sender->displayname . " Sent me a message , The content of the message is :" . $msg->content;
}
elsif($msg->type eq "group_message"){# Group message received
my $group = $msg->group; # Get the group object corresponding to the message
$sender = $msg->sender; # Get the group member object that sent the message
$friend=$sender->displayname;
# print $sender->displayname . " In groups :", $group->displayname . " There's a message from , The content of the message is :" . $msg->content;
} $sender Object content : $var is $VAR1 = bless( {
'id' => '@89c70523a465a6a42cc32cbaa7f2554563bf67776d021f32541986fb8c197974',
'city' => '',
'sex' => '',
'markname' => '',
'name' => ' Yo yo ',
'_group_id' => '@@afb74b7076b5b1dae582ffbb506ab8d354ef172d6ff58b654d9157b04e125235',
'province' => '',
'account' => '',
'signature' => '',
'display' => 'yy'
}, 'Mojo::Weixin::Group::Member' ); see display Method : sub displayname{
my $self = shift;
return $self->display || $self->markname || $self->name;
} We don't need a group nickname It is amended as follows
sub displayname{
my $self = shift;
return $self->name;
} name: Wechat nickname display: Group nicknames

modify MojoWeixin Keep users only name More articles about canceling group nicknames

  1. SQL according to B Table content modification A Table content , Duplicate records in the query table , Delete duplicate items and keep only one

    following sql yes a,b The two tables are linked by conditions id modify a Table value , If b The table has duplicate data records , Select the first update , The red condition is an additional restriction , It depends on the situation : UPDATE a SETname = b.fname,pwd = b ...

  2. linux How to modify the user permissions of a folder in chown command

    linux in , have access to chown Command to modify the user permissions of the folder . 1.  As an ordinary user  A  Sign in linux, utilize su - Switch to root user 2. stay root Under the user , You can see the contents of the folder 3. But through the file system , ...

  3. [ turn ]android Use shape stroke Stroke only the bottom

    In the case of a project : For some reason , I need to use LinearLayout The vertical layout makes ListView The effect of , however ListView It comes with a dividing line , And there's no dividing line at the top and bottom , Every item It's all in the middle ...

  4. ORA-01013: The user requested to cancel the current operation

    ORA-01013: The user requested to cancel the current operation In the test a pass ODBC Connect ORACLE Database VB The program , There is always this error , It is estimated that the amount of data is relatively large , Cause timeout . There are four ways to solve it  ( Choose any one ): ...

  5. ASP.NET Filter HTML The method of keeping only newlines and spaces in labels

    This article mainly introduces ASP.NET Filter HTML The method of keeping only newlines and spaces in labels , Including common methods on the Internet and improvements to this method , It has certain reference value , Friends in need can refer to   This article gives an example of ASP.NET Filter HTML ...

  6. Win10 The system modifies the host name 、 User name and password 、 as well as C The name of the user's folder on the disk

    Write it at the front Recently reinstalled Ubuntu16.04 System , It was also modified Windows10 User name of the system . password , also C Disk user folder name . about Linux and windows system , Changing the name is basically three parts , Host name . use ...

  7. Oracle&#160; modify SYS、system User password

    Oracle modify SYS.system User password by: Give the guest QQ:1033553122 Concept SYS User is Oracle The most privileged user in , and SYSTEM Is a user for database management . After the database is installed , Should be ...

  8. Linux Command application dictionary - The first 13 Chapter User and group management

    13.1 useradd: Create user accounts 13.2 adduser: Create user accounts 13.3 lnewusers: Create user accounts 13.4 usermod: Modify user account 13.5 userdel: Delete user account ...

  9. use mongodb The fixed set implementation keeps only a fixed number of records , Automatically eliminate old data

    In a save report In the recorded scene , We use MongoDB Data storage example: db: report Collection: daily_report establish db:  use report; ...

Random recommendation

  1. vi Editor use

    According to the line Numbers set nu Cancel the line Numbers set nonu Navigate to a row gg Go to the first line G Go to the last line stay VI In the editor, switch to call external shell command :!ifconfig   In the editing process , see ip Address insert ...

  2. Endless Sky Source learning notes -5

    After the game started UI Divided into three areas , Scroll left credits And so on, as well as preferences and exit buttons , Loading animation in the middle , The player information and the load archive button are displayed on the right side , call void MenuPanel::Draw() Realization . First draw ...

  3. Data structures and algorithms &ndash; 11. Advanced sorting algorithm ( Next )

    3、 ... and . Select the sort of class 3.1. Simple selection sort http://www.cnblogs.com/tangge/p/5338734.html#XuanZe 3.2 Heap sort You know heap sorting , First, we need to understand the binary tree model . ...

  4. mysql Common operators and use

    mysql There is 4 Class operators , They are : Arithmetic operator Comparison operator Logical operators Bitwise operators arithmetic operator The arithmetic operator is SQL The most basic operation operator in , There are several operators : +( Add ). -( reduce ). *( ride ). / ...

  5. 12、 With the help of Jacob Realization Java Print report (Excel、Word)

    12. Use Jacob To process documents Word or Excel The program is based on COM In the form of components . If you can Java The corresponding components are called , You can use its method to get the text information in the document .Jacob It's a JAVA To Microsoft COM Pick up ...

  6. SSO The frame introduces the first part

    SSO All the way through single sign on, Single sign on , It's a unified authentication and authorization mechanism .   Single sign on , It refers to the same user accessing protected resources in different applications of the same server , Just log in once , That is, after passing the security verification in an application , Visit it again ...

  7. UVALive 3882 - And Then There Was One【 Joseph's question 】

    Topic link :https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...

  8. java Keyboard Entry (Scanner)

    Keyboard Entry (Scanner)• Overview of keyboard input data – We are currently writing programs , Data values are fixed , But in actual development , The data values must have changed , therefore , Improve the data into keyboard input , Improve the flexibility of the program .• How to implement keys ...

  9. spring start-up component-scan Class scan loading process ( turn )

    Article transferred from  http://www.it165.net/pro/html/201406/15205.html A friend recently asked  spring  The process of loading a class , Especially based on  annotation  Annotation loading process ...

  10. Line tree merge || Tree array || discretization || BZOJ 4756: [Usaco2017 Jan]Promotion Counting || Luogu P3605 [USACO17JAN]Promotion Counting Promotion count

    Topic :P3605 [USACO17JAN]Promotion Counting Promotion count Answer key : This is a universal problem , Tree array || Chairman tree || Line tree merge || Mo team sets up blocks || Line segment tree Can write .. remember ...